Microphone.names

Availability

Usage

public static names : Array {read-only]

NOTE

 

The correct syntax is Microphone.names. To assign the return value to a variable, use syntax like var micNames_array:Array = Microphone.names. To determine the name of the current microphone, use active_mic.name, where active_mic is the variable to which you assigned the results of Microphone.get().

Description

Class property (read-only); retrieves an array of strings reflecting the names of all available sound capture devices without displaying the Flash Player Privacy dialog box. This array behaves the same as any other ActionScript array, implicitly providing the zero-based index of each sound capture device and the number of sound capture devices on the system (by means of Microphone.names.length). For more information, see the Array class entry in ActionScript 2.0 Language Reference.

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:

var allMicNames_array:Array = Microphone.names;
trace("Microphone.names located these device(s):");
for(i=0; i < allMicNames_array.length; i++){
 trace("[" + i + "]: " + allMicNames_array[i]);
}

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 entry in the ActionScript 2.0 Language Reference, Microphone.get(), Microphone.name


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000557.html