Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Multi Channel Audio inputs

Discussion in 'Editor & General Support' started by Lando1000, Apr 9, 2013.

  1. Lando1000

    Lando1000

    Joined:
    Sep 28, 2012
    Posts:
    14
    Hi Unity Peeps,

    Does any one know if you can select particular channels on external audio devices. I have a MOTU traveler (16 channel firewire interface), unity recognises it and i receive an input from it only through channel 1 on the MOTU and when i ask unity how many channels the device has, it says 1. Anyone have any ideas or even know if its possible to access the other channels?

    Im running Unity 3.5.7 on OSX 10.7.5 building for a PC/Mac stand alone

    Thanks in advance
    Lando
     
    dshimmyo likes this.
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Maybe the Audio Manager can help?

    http://docs.unity3d.com/Documentation/Components/class-AudioManager.html

    Just set the Default Speaker Mode to one of this

    Code (csharp):
    1. Raw
    2. Channel count is unaffected.
    3.  
    4. Mono   
    5. Channel count is set to 1. The speakers are monaural.
    6.  
    7. Stereo 
    8. Channel count is set to 2. The speakers are stereo. This is the editor default.
    9.  
    10. Quad   
    11. Channel count is set to 4. 4 speaker setup. This includes front left, front right, rear left, rear right.
    12.  
    13. Surround   
    14. Channel count is set to 5. 5 speaker setup. This includes front left, front right, center, rear left, rear right.
    15.  
    16. Mode5point1
    17. Channel count is set to 6. 5.1 speaker setup. This includes front left, front right, center, rear left, rear right and a subwoofer.
    18.  
    19. Mode7point1
    20. Channel count is set to 8. 7.1 speaker setup. This includes front left, front right, center, rear left, rear right, side left, side right and a subwoofer.
    21.  
    22. Prologic   
    23.  
    24. Channel count is set to 2. Stereo output, but data is encoded in a way that is picked up by a Prologic/Prologic2 decoder and split into a 5.1 speaker setup.
    25.  
    http://docs.unity3d.com/Documentation/ScriptReference/AudioSpeakerMode.html
     
  3. Lando1000

    Lando1000

    Joined:
    Sep 28, 2012
    Posts:
    14
    I did try this and it still tells me theres 1 audio channel, correct me if I'm wrong but this is for audio outputs not inputs isn't it?
     
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Oh im sorry reading .. should be done before posting....
    Im not sure if unity can have multiple audio inputs.
    Maybe an plug in is needed to grab all the audio inputs.
    How do you connect the input to unity?
     
  5. Lando1000

    Lando1000

    Joined:
    Sep 28, 2012
    Posts:
    14
    i have a firewire audio interface (MOTU traveler), i ask what devices are available:

    foreach (string device in Microphone.devices)
    {
    Debug.Log("Name: " + device);
    }

    my MOTU shows up which i then do:

    audio.clip = Microphone.Start("MOTU Traveler", true, 10, 44100);

    this allows me to use the first input of the MOTU, i also ask the number of channels:

    Debug.Log(audio.clip.channels);

    which it returns 1. I don't know if I'm going the right way about it or not but hopefully someone can point me in the right direction as i want to have 16 inputs if unity will let me to make an orchestra control graphics on a screen.
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity has no multitchannel input support, only multichannel output thats generated basing on the spatial position of sounds in 3D space.

    Actually no engine has such support as it makes no sense, the sound would not operate as a 3D sound anymore and the only sound type where thats the case is 2D mono audio normally.
     
  7. Lando1000

    Lando1000

    Joined:
    Sep 28, 2012
    Posts:
    14
    think ive managed to do it :) abit more testing to do, it involved making an xcode project that can read the different channels of the interface then just send the packets of data to unity. You say that it makes no sense to do this but i believe there is as more and more people like myself use unity not just as a game engine but a creative and exploratory environment for making things like art installations and interactive kiosks.
     
  8. limeforce

    limeforce

    Joined:
    Mar 4, 2013
    Posts:
    3
    Wow, I've been thinking about MOTU+Unity (or similar) all day today! Glad to see someone else thinking about the same stuff. Unity definitely has potential outside the normal game engine usage!
     
  9. silverwizard

    silverwizard

    Joined:
    Jan 17, 2013
    Posts:
    8
    Hi all, allow me to join the club that would like to see more support for multichannel audio input in Unity. I encountered exactly the same problems, and in my case using two separate microphones is not an option (the equipment I am using is transmitting data in sound format, which are processed in Unity, and the two channels carry different information).

    So, Lando1000, is your solution easy to explain to a novice programmer? Does anyone have any pointers as to how this problem might be tackled in a relatively straightforward manner?
     
  10. memoid

    memoid

    Joined:
    Aug 30, 2014
    Posts:
    10
    Hi just wondering if there's any updates on this. For an upcoming project I need 16 independent audio-ins (with a Motu 16a). Is this possible with unity? (my motu hasn't arrived yet, but I'd like to start developing in the meantime, and if Unity can't do this I'll switch to something else).
     
  11. luisa_ph

    luisa_ph

    Joined:
    Mar 25, 2016
    Posts:
    1
    Hello ––any news on this?
     
  12. stepan-stulov

    stepan-stulov

    Joined:
    Nov 26, 2013
    Posts:
    28
    Wondering the same.
     
  13. dbaylies

    dbaylies

    Joined:
    Jul 11, 2018
    Posts:
    1
    Also very interested in this! I'd like to have Unity receive mutichannel input from Soundflower, or similar, so that I can send each channel to a different AudioSource in real time.

    Currently trying to work with the Microphone class, but I keep getting strange behavior.
     
  14. kalimerox

    kalimerox

    Joined:
    Jan 9, 2019
    Posts:
    1
    very interested in this! would be great to hear from people who managed to have set up something in unity with multichannels ins and outs. I m working on an ambisonics sound project and i am also thinking about doing it in unity, but it s hard to get hold of some user experiences for these topics...
     
  15. chikashimiyama

    chikashimiyama

    Joined:
    Mar 5, 2018
    Posts:
    2
    I'm also interested in it.
    I think many people are using Unity as an audio visualization or VJ software nowadays but I don't think Unity is going to support multichannel inputs soon.

    But we might make a native audio plugin that accesses the audio card via port audio or rtAudio. What do you guys think?
     
    dshimmyo likes this.
  16. basisbit

    basisbit

    Joined:
    Aug 28, 2017
    Posts:
    3
    I'd also be interested in this. Lots of soundcards use one input channel for each connected microphone, but the soundcard only shows up as one device and thus unity only allows accessing the first microphone per input soundcard. I'd consider this a bug on Windows, Linux and macOS. This problem exists already for a long time in Unity framework. Although this would be rather easy to fix for Unity, they still don't seem to care.
     
  17. jeffcrouse

    jeffcrouse

    Joined:
    Apr 30, 2010
    Posts:
    18
    In my particular setup, I want to be able to output multiple channels of audio from Ableton Live and route each of them to different Audio Sources in Unity.

    I'd love to be able to do some kind of loopback setup with my MOTU, but as everyone is saying, Unity doesn't have the capability to specify the channel of the input you want to read.

    So the best I've been able to find is using Jack Audio, which, if you're not familiar, acts like a virtual audio device that you can send audio to. rodrigodzf was even nice enough to make a receiver for Unity: https://github.com/rodrigodzf/Jack-Audio-For-Unity

    This allows me to use Jack Audio as my output from Ableton, and then attach a "JackReceive" to an Audio Source, et voila. Multi-channel audio input in Unity. The setup is a bit of a pain, but it works.

    My only problem now is that Ableton only shows up as having 4 outputs.



    I realize this is more of an Ableton and Jack question than a Unity question, but Google led me here and Google can't be wrong. So if anyone has any ideas, please let me know!