Im trying a simple test with the microphone on my MacBook pro but Im unable to get it working. What am I missing here?
void Start()
{
_audioSource = GetComponent<AudioSource>();
if (useMicrophone)
{
if (UnityEngine.Microphone.devices.Length > 0)
{
selectedDevice = UnityEngine.Microphone.devices[1].ToString();
Debug.Log("using mic " + selectedDevice);
_audioSource.clip = UnityEngine.Microphone.Start(selectedDevice, true, 10, AudioSettings.outputSampleRate);
}
}
_audioSource.Play();
}