# Two headphones for two players

We're looking to create a split screen game using Unity that is highly reliant on audio. We would need each player to have their own headphones and use positional audio to navigate through the map.

Is it possible to output different sound (depend on each player's location) to a set of headphones? If I remember correctly, there may be a limitation in Unity and Windows where only one output device can be used. Is this true or is there some way to go about doing this?

If not, would we just have to resolve to running two instances of the game and using network play?

Thanks!

• You seem to assume the user is using a headset. I would assume the opposite - I know a lot of gamers that don't have a headset. They all have phones, though, and as a result, they almost all have 3.5mm earphones. Have you considered asking the user to use a single headset, and using the channels as your player one and player two? If you ask player one to use the left earpiece, and player two to use the right earpiece, this might be a suitable solution for local play. – Gnemlock Feb 4 '17 at 3:16
• Windows abstracts the raw input and output away (this is also the same reason you can't tell which keyboard he/she uses). If you want to output different sounds for different audio devices, then you need to somehow do that yourself. Considering that you use unity, there's a really low chance you can actually do this. Also, there are almost no sound cards that have two outputs, and using a splitter is like using only one audio device – Bálint Feb 4 '17 at 14:06
• @Gnemlock raises an interesting point about phones. If a single computer is unlikely to have two audio outputs that you can control independently, could you instead run a companion game on each player's phone, which receives networked instructions about what audio to play? Like the Jackbox games, this would let you scale to an arbitrary number of players who each bring their own phone & earbuds, so long as your gameplay & audio design can tolerate a small amount of wifi latency... – DMGregory Feb 4 '17 at 15:14
• Sorry, I missed an important point. The first prototype will be shown at a game conference, so we have full control and will provide two headphones. Using channels will eliminate the ability to use 3D positional audio to find sources of the audio. As for different audio devices, I was thinking that front and back audio on a computer does act as separate devices, so this may work. Just not sure how to make this work in Unity. – Abubakr Feb 4 '17 at 18:10
• @Abubakr You should edit the question and add that in! – Vaillancourt Feb 4 '17 at 21:47

You could try using NAudio which is just that, it lets you create IWavePlayers for multiple audio devices and playback APIs.