M > Microphone.gain |  |

Microphone.gain

Microphone, audio, sound, Microphone.gain, gain

Communications/Microphone/Properties/gain

Availability

Flash Player 6.

Usage

    activeMicrophone.gain

Description

Read-only property; the amount by which the microphone boosts the signal. Valid values are 0 to 100. The default value is 50.

Example

The following example is attached to the nib of a slide bar. When this clip is loaded, Flash checks for the value `myMic.gain` and provides a default value if this value is undefined. The `_x` position is then used to set the gain on the microphone to the user's preference.

    onClipEvent (load) {
    	if (_root.myMic.gain == undefined) {
    		_root.myMic.setGain = 75;
    	}

    	this._x = _root.myMic.gain;
    	_root.txt_micgain = this._x;

    	left = this._x;
    	right = left+50;
    	top = this._y;
    	bottom = top;
    }

    on (press) {
    	startDrag(this, false, left, top, right, bottom);
    	this._xscale = 100;
    	this._yscale = 100;
    }

    on (release, releaseOutside) {
    	stopDrag();
    	g = (this._x-50)*2;
    	_root.myMic.setGain(g);
    	_root.txt_micgain = g;
    	this._xscale = 100;
    	this._yscale = 100;
    }

See also

`Microphone.setGain`