Every now and then a project comes along that requires special manipulation of sound. On a recent project I had to deploy a three screen, three station user experience. In order to keep the costs down and programming streamlined, I specified the experience run on one computer. The trick here was that we needed to create the illusion of three individual stations.
To turn one computer into three stations, I needed to create the illusion that each individual station had it's own sound effects and ambiance. In hardware, this entails using a 5.1 surround sound card to output to six individual channels. So for this experience we used the following configuration:
By placing six stereo pairs of speakers across the three stations, we can create the illusion of three individual stations by directing our sound effects to the appropriate speakers.Programming this solution turned out to be way more difficult than anticipated. The kiosk software itself was built in Adobe AIR. AIR does not support more than stereo.
I turned to another favorite language, C# for help and came across the Naudio project. Although Naudio supports re-mapping the output of sound channels, (which is what I needed to do; direct my sound effects to specific speakers only) it does not support surround setups very well. I was unable to use naudio.
The final solution I ended up using was a windows presentation foundation console application that implemented a simple TCP socket server. This application uses at its core, the Windows Presentation Foundation MediaElement. MediaElement can play 5.1 or 7.1 specially crafted wav files.
In the end instead of directing stereo sound effects to different channels, I created individual 5.1 wav files using audacity for each sound effect in each set of speakers. This has proved to be a reliable way to utilize surround sound in kiosk applications written in any programming language that supports TCP socket connections.