Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Microphone.devices

static var devices: string[];
static string[] devices;
static devices as string[]

Description

A list of available microphone devices, identified by name.

You can use the name with the Start and End functions to specify which microphone you wish to start/stop recording.

	// Get list of Microphone devices and print the names to the log
	function Start () {
		for (var device in Microphone.devices)
		{
			Debug.Log("Name: " + device);
		}
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Start() {
        foreach (string device in Microphone.devices) {
            Debug.Log("Name: " + device);
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Start() as void:
		for device as string in Microphone.devices:
			Debug.Log(('Name: ' + device))

See Also: Start, End, IsRecording.