Search Unity

Audio How to record stereo sound in Unity

Discussion in 'Audio & Video' started by yuki_abe, Mar 12, 2018.

  1. yuki_abe

    yuki_abe

    Joined:
    May 28, 2014
    Posts:
    2
    I have a question about Microphone class.
    https://docs.unity3d.com/540/Documentation/ScriptReference/Microphone.html

    I tried to record stereo sounds by using the Microphone class, but I noticed the sounds turned to monaural. The channel in AudioClip which was generated by Microphone.Start() was 1, so I'm guessing that Unity is recognizing the sound is monaural.

    The version of Unity I'm using is 2017.1.1f1.
    The recording device I'm using is:
    https://www.amazon.com/Roland-UA-4FX2-interface-STATION-UA-4FXII/dp/B01N2OG32G

    Could you tell me how to record stereo sound in Unity?
    Any advice and suggestions will be greatly appreciated.

    Thanks,
     
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    It's .. complicated - Microphone class does not support multichannel input

    you can try kzr's audio input plugin: https://github.com/keijiro/Lasp - you have to try it out since I'm not sure whether PortAudio - which it uses - supports multichannel input.

    Another option would be looking at some 3rd party plugins such as FMOD or WWise and their unity integrations.
    I've only used FMOD, so that works, but you'd have to do some coding to make it work, or possibly use FMOD Studio.

    To spare some time still you can use my plugin - link in signature - which is built on top of FMOD low level API and exposes it for unity's AudioSource
     
  3. yuki_abe

    yuki_abe

    Joined:
    May 28, 2014
    Posts:
    2
    I really appreciate your detailed answer.
    I will try the method you taught me.

    Thanks,
    Yuki
     
    r618 likes this.
  4. asifoncue

    asifoncue

    Joined:
    Dec 8, 2014
    Posts:
    12
    Did you solve your issue, Yuki? I'm having trouble using multiple channels from my audio interface in Unity, and I've yet to find an efficient solution.