Search Unity

Audio Fix my Mic Input

Discussion in 'Audio & Video' started by Samtastic, Jul 24, 2019.

  1. Samtastic

    Samtastic

    Joined:
    Sep 12, 2016
    Posts:
    14
    I am making an audio game called Cyrstal Ball on which the game uses mic input. I have an issue where it picks up microphone feedback whilst it's recording.How do I adjust this script so that the game will not pick up microphone whilst recording audio?


    Code (CSharp):
    1.   private void StartRecording()
    2.     {
    3.         source.outputAudioMixerGroup = mixer;
    4.         Debug.Log("Total found mic : " + Microphone.devices.Length);
    5.         source.clip = Microphone.Start(null, true, (int)recordingTimeToWaitInSecs, 22050);
    6.         while (!(Microphone.GetPosition(null) > 0)) { }
    7.         Debug.Log("start playing... position is " + Microphone.GetPosition(null));
    8.         source.Play();
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    i didnt have issues when tested recording in android last time..

    wasnt using mixer though, and i used first device name (instead of null),
    also called microphone.end after recording..