Showing results for 
Search instead for 
Did you mean: 

Simultanious Sound?

Go to solution

Is it possible to send two waveforms to the soundcard at the same time or do the waveforms first have to be mixed?

LabVIEW 2012

0 Kudos
Message 1 of 4

I don't think the LabVIEW sound API supports multiple audio streams (or buffers, I've forgotten what the correct term is). Can you get away with just adding the two waveforms before passing to the sound output write VI?


I did have one application where I needed to be able to play multiple .WAV files at the same time (sound effects for a game).  What I ended up doing was using the .NET DirectSound API with a lightweight wrapper DLL.  It only works with .WAV files but if it would help I could dig it up and post it.





Message 2 of 4
Hey what a coincidence, the reason I was asking about this is for a game.

I would really appreciate it if you could dig up the code.

LabVIEW 2012

0 Kudos
Message 3 of 4
Accepted by SteveChandler


I'm hoping it's fairly self explanitory.  This is how you'd use it:

Screen Shot 2011-09-28 at 9.43.39 AM.png


I've also just realized my example doesn't explicitly close the .NET reference.  You should probably do this, like so:


 Screen Shot 2011-09-28 at 9.44.31 AM.png


The game I created this for was the Angry Eagles demo we showed at NIWeek.  You can grab the source for the game here to see it used in context - (or if you use the actor framework you can just grab the SoundManager actor and drop it in).


Have fun!



Message 4 of 4