Best Practice for 5.1 Surround Sound?

Well… what is the best practice for playing 5.1 sound within a JME application?

Should I maybe use Java Sound and not JME sound API? I’m sure someone here must’ve something to say…

Well did you just try to place a soundemmiter with positional sound?

As far as I know it should work if your os is configured correctly.

I did not yet try. The hardware is yet to come soon, and I am trying to do some research ahead of time. As far as I understand, you mean that if my OS is configured for 5.1, then the positional audio emitters will be ok automatically… Well, the additional difficulty is that I want to play a movie with 5.1 sound pre-recorded. So I am not sure that JME has anything to do with it at all, but I thought I’d ask.

Although not really JME-related, but I decided I better post my findings, maybe someone else will need it sometime. Actually, nothing fancy - I ended up using Xuggler, as many people have suggested on the web. Xuggler is not actively mainained anymore (last commit was like 2 years ago or something), but is open-source and worked for me.

So I can read a movie file with 5.1 encoded in aac3 and either play it, using Java Sound on a 6-channel line if a 5.1 sound card is present in the system or create 6 mono lines, depending on the actual hardware I have…

So you just want to play pre-mixed 5.1 tracks? Anyway if you have set up your soundcard for 5.1 then openAL should pick that up and use it.

Yes, that is what I want and what you’re saying looks like to work that way, but the soundtracks are stored in the movie container with the movie itself and in order to extract them, Xuggler has to be used. I believe that if I could make them to be separate wav or ogg files, then JME or Java Sound would be able to play them out-of-the-box, but then still there would remain the task of synchronizing video and audio…I haven’t yet implemented full Xuggler solution, but in its examples it has a sample code where video and audio are extracted and played simultaneously. So looks like, I will have to abandon my favourite JavaCV video playback for JME and use Xuggler for this current project.