- Home /
How do I tell if the microphone is working?
I'm trying to use the microphone in 3.5. So far I get nothing. I can't get any indication that it's working.
I checked out the connected devices using this code
for (var device in Microphone.devices)
{
display+="Name: " + device + "\n";
}
And I'm using a Blue Snowball -- a mic that's connected. My code looks like this
audio.clip = Microphone.Start("Blue Snowball", true, 10, 44100);
audio.Play();
How do I tell if anything is working. I have an audio source on the main gameObject that the code above is attached to and there is an audio listener on the camera. In the inspector it says microphone but I'm not seeing anything.
The mic I have "Blue Snowball" works fine for ichat and other input so it's working.
Answer by Oliver Eberlei · Apr 17, 2012 at 02:32 AM
Playing the audio right away was problematic for me as well. Delaying the playback a little bit worked for me. In the Update() function I did this:
if( audio.isPlaying == false && Microphone.GetPosition( DeviceName ) > 1 )
{
audio.Play();
}
Answer by MarkD · Mar 30, 2014 at 01:19 PM
I know this is an old question but this script streams all microphone input data to a single float https://www.assetstore.unity3d.com/#/content/12518
You can select a debug option to see in the console if your mic is working or you can select listen to hear yourself speak, it is open source so you can simply extract the part that you need or use the script itself.
Your answer
Follow this Question
Related Questions
Microphone Failed Result=33 0 Answers
Microphone.GetComponent () not working + Microphone.devices empty? 0 Answers
Unity 4.6 no microphone devices 0 Answers
Microphone in 3.5 beta 1 Answer