Microphone.setgain() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Microphone.setGain()

Availability
Flash Player 6.
Usage
active_mic.setGain(gain:Number) : Void
Parameters
An integer that specifies the amount by which the microphone should boost the signal.
gain
Valid values are 0 to 100. The default value is 50; however, the user may change this value in the
Flash Player Microphone Settings panel.
Returns
Nothing.
Description
Method; sets the microphone gain—that is, the amount by which the microphone should
multiply the signal before transmitting it. A value of 0 tells Flash to multiply by 0; that is, the
microphone transmits no sound.
You can think of this setting like a volume knob on a stereo: 0 is no volume and 50 is normal
volume; numbers below 50 specify lower than normal volume, while numbers above 50 specify
higher than normal volume.
Example
The following example uses a ProgressBar instance called
NumericStepper instance called
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
gain_pb.label = "Gain: %3";
gain_pb.mode = "manual";
gain_pb.setProgress(active_mic.gain, 100);
gain_nstep.value = active_mic.gain;
function changeGain() {
active_mic.setGain(gain_nstep.value);
gain_pb.setProgress(active_mic.gain, 100);
}
gain_nstep.addEventListener("change", changeGain);
See also
Microphone.gain,
gain_nstep
Microphone.setUseEchoSuppression()
to display and a
gain_pb
to set the microphone's gain value.
Microphone.setGain()
461

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents