LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultanious Sound?

Solved!
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
(2,418 Views)

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.

 

Regards,

 

Simon

Message 2 of 4
(2,405 Views)
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.

Thanks!
=====================
LabVIEW 2012


0 Kudos
Message 3 of 4
(2,396 Views)
Solution
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 - https://decibel.ni.com/content/docs/DOC-17552 (or if you use the actor framework you can just grab the SoundManager actor and drop it in).

 

Have fun!

 

~Simon

Message 4 of 4
(2,380 Views)