Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working on a mobile app inside Unity, 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, until audio is completely muted..

Why is that? Is there any particular setting I should go through? Or do I have to change something in my code?

share|improve this question
    
How are you listening to the audio on your computer versus your phone? If you are hearing an echo, it could be from feedback from your speakers being picked up from the phones mic. Have you tried using headphones? –  BrianGameDev Feb 13 at 3:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.