Multi Channel Audio inputs

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

1 Like

Maybe the Audio Manager can help?

Just set the Default Speaker Mode to one of this

Raw	
Channel count is unaffected.

Mono	
Channel count is set to 1. The speakers are monaural.

Stereo	
Channel count is set to 2. The speakers are stereo. This is the editor default.

Quad	
Channel count is set to 4. 4 speaker setup. This includes front left, front right, rear left, rear right.

Surround	
Channel count is set to 5. 5 speaker setup. This includes front left, front right, center, rear left, rear right.

Mode5point1	
Channel count is set to 6. 5.1 speaker setup. This includes front left, front right, center, rear left, rear right and a subwoofer.

Mode7point1	
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.

Prologic	

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.

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?

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?

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.

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.

think ive managed to do it :slight_smile: 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.

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!

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?

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).

Hello ––any news on this?

Wondering the same.

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.

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…

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?

1 Like

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.

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: GitHub - rodrigodzf/Jack-Audio-For-Unity: Jack Audio support for Unity3d

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!