Does anyone know how to get Unity to play back a microphone input in real time? I’ve managed to get it record an audio clip and then play it back on demand, but no methods I’ve used will make it play back real-time, it will either make an inaudible chopped noise, or an infinite feedback loop.
Can you explain what this bit is doing and why it is necessary?
while (!(Microphone.GetPosition(null) > 0)){}
I just added that and it solved a lot of my problems! Thank you very much. Just wanting to understand why it is necessary, and why the only reference I’ve found to such a fix is a 0-voted comment in the forums :S .
@eguels
Thanks for posting this, I have been struggling with this problem for a long time. Unfortunately when I tried your solution I still get a very noticeable delay (about 1 second) between when I say something and when I hear it through my headset. Is that to be expected? I’m not using the wait function shown in the other answer.