The Microphone object controls access to the microphone input attached to a client's computer. The Microphone object controls capture settings, including sample and gain. You can also set the microphone to trigger events when it detects sound (or silence). The Flash Communication Server is required to record or transmit the microphone source to other Flash clients ; however, the Microphone object can be accessed locally without the server. The Microphone object is enabled using the Microphone.get() method. To enable Code Hints and Code Completion in the Flash MX ActionScript Editor, use the suffix _mic in the name of the Microphone variable. Microphone MethodsMicrophone.get([index])Captures the microphone feed and assigns it to a MovieClip object or a NetStream. You can quickly access the microphone feed using attachAudio .
Microphone.setGain(gain)Sets the amount of gain (or volume increase) to apply to the microphone.
Microphone.setRate(kHz)Sets the frequency (or sample rate) in kilohertz (kHz) of the sound capture driver.
Microphone.setSilenceLevel(level [, timeout])Sets the sound sensitivity or how much sound is required to trigger the Microphone.onActivity event.
Microphone.setUseEchoSuppression(suppress)Sets the echo suppression filter setting in the audio compressor.
Microphone PropertiesMicrophone.activityLevel returns the amount of sound being received through the microphone source. It is great for VU meters . Microphone.gain returns the gain value being applied to the sound source. This can be set using the Microphone.setGain() function. Microphone.index returns the index value of the current microphone being used. Microphone.muted returns the Boolean value if microphone access is granted by the user. Microphone.name returns the manufacturer's name of the current sound capture device. Microphone.names returns an array of strings containing the names of all microphone sources available to the Flash player. This will not invoke the Privacy Settings panel. Microphone.rate returns the current sound capture frequency or sample rate in kHz. Microphone.silenceLevel returns the value of the sensitivity setting set using Microphone.setSilenceLevel() . Microphone.silenceTimeout returns the value of time, in milliseconds, to trigger a false Microphone.onActivity event. Microphone.useEchoSuppression returns a Boolean value indicating the status of the echo suppression filter. Microphone EventsMicrophone.onActivity is invoked when the microphone senses or stops sensing sound in the microphone range. This event can be controlled using Microphone.setSilenceLevel . Microphone.onStatus is invoked when the status of the microphone changes. The status changes only if the user denies microphone access in the Flash player's Privacy panel. This event will receive a Microphone Information object detailed in Appendix C. |