Home > APIs > AppServer API > Examples > Timeline and Transport Control > Channel Gain and Muting
Channel Gain and Muting
For each channel, you can mute all tracks or you can change the input or output gains of each individual track. If you set a channel's "muteaudio" property to true, then all tracks of the channel will be muted. Individual tracks cannot be muted, but their output gain can be changed. The minimum gain value that may be assigned is -40.0 dB and the maximum gain value is +24.0 dB.
Below is example code showing how to mute a channel and change input and output gain of tracks.
// create a controller bool isNewController = false; ISimpleController icontroller = iappServer.CreateController( appName, channel, out isNewController); //////////////////// // mute channel //////////////////// // get channel's mute audio status bool mute = (bool) icontroller.GetChannelProperty("muteaudio"); Console.WriteLine("mute audio = " + mute); // flip channel's mute audio status icontroller.SetChannelProperty("muteaudio", !mute); // true or false mute = (bool) icontroller.GetChannelProperty("muteaudio"); Console.WriteLine("mute audio = " + mute); // flip it back icontroller.SetChannelProperty("muteaudio", !mute); // true or false mute = (bool) icontroller.GetChannelProperty("muteaudio"); Console.WriteLine("mute audio = " + mute); //////////////// // adjust gain //////////////// // set the input gain of track 0 to -3.0 dB icontroller.SetResourcePropertyEx ("Audio", 0, "inputgain", -3, true); object gain = icontroller.GetResourceProperty("Audio", 0, "inputgain"); Console.WriteLine("input gain = " + gain); // set the input gain of track 0 to 0.0 dB (unity gain) icontroller.SetResourcePropertyEx ("Audio", 0, "inputgain", 0, true); gain = icontroller.GetResourceProperty("Audio", 0, "inputgain"); Console.WriteLine("input gain = " + gain); // set the output gain of track 0 to -40.0 dB icontroller.SetResourcePropertyEx ("Audio", 0, "outputgain", -40, true); gain = icontroller.GetResourceProperty("Audio", 0, "outputgain"); Console.WriteLine("output gain = " + gain); // set the output gain of track 0 to 0.0 (unity gain) icontroller.SetResourcePropertyEx ("Audio", 0, "outputgain", 0, true); gain = icontroller.GetResourceProperty("Audio", 0, "outputgain"); Console.WriteLine("output gain = " + gain); // close the channel icontroller.CloseChannel(); iappServer.CloseConnection();