- Home /
Strange Echo when recording and instantly playing sound from mobile device
I'm working on a mobile app, in which I need to input and repeat microphone input almost immediately..
I've worked it out and it works great when I play it from within the Unity Editor. I get some very strange behavior though when I try it from my Android phone (Galaxy Note 3)..
So I decided to run some tests and noticed quite different behavior..
Using this sample code:
using UnityEngine;
using System.Collections;
public class testingMicScript : MonoBehaviour {
void Start () {
audio.loop = true;
audio.clip = Microphone.Start (null,true,10,44100);
while(!(Microphone.GetPosition(null)>0)){}
audio.Play ();
}
}
and playing it from withing the Editor it works great, I speak and hear myself back after a few milliseconds. I compile the app and run it from my phone and when I speak I get a very strange echo which goes on until the sound is completely distorted and I get a strange hiss..
Why is that? Is there any particular setting I should go through? Or do I have to change something in my code..
Were you able to fix this problem? We are facing similar feedback loop issues.