468 Chapter 12: ActionScript Dictionary
Calling Microphone.names requires an extensive examination of the hardware, and it may take
several seconds to build the array. In most cases, you can just use the default microphone.
Example
The following code returns information on the array of audio devices.
allMicNames_array = Microphone.names;
_root.debugWindow += "Microphone.names located these device(s):" + newline;
for(i=0; i < allMicNames_array.length; i++){
debugWindow += "[" + i + "]: " + allMicNames[i] + newline;
}
For example, the following information could be displayed.
Microphone.names located these device(s):
[0]: Crystal SoundFusion(tm)
[1]: USB Audio Device
See also
Array class, Microphone.name
Microphone.onActivity
Availability
Flash Player 6.
Usage
activeMicrophone.onActivity = function(activity) {
// your statements here
}
Parameters
activity
A Boolean value set to true when the microphone starts detecting sound, false
when it stops.
Returns
Nothing.
Description
Event handler; invoked when the microphone starts or stops detecting sound. If you want to
respond to this event handler, you must create a function to process its
activity value.
To specify the amount of sound required to invoke
Microphone.onActivity(true), and the
amount of time that must elapse without sound before
Microphone.onActivity(false) is
invoked, use
Microphone.setSilenceLevel().
Example
The following example displays true or false in the Output panel when the microphone starts
or stops detecting sound.
m = Microphone.get();
_root.attachAudio(m);
m.onActivity = function(mode)
{