11-04-2010 11:54 AM
Hello all.
With the help from old board posts and the example VIs packaged with Labview 2009 SP1, I was able to get part of the way.
The goal is to simutaneously play two .wav files, to two different sound cards. So far:
1) I can play one wav file to either sound card
2) I can generate two sine waves of different tones, and push each out to the two cards seperately simutaneously.
But when I replace those two tones from #2 with .wav files, the wave files play alternately. So wav_1 plays to sound_card_1, THEN wav_2 plays to sound_card_2, not simutaneously.
Is it even possible to play 2 wav files simutaneously out to different cards?
I've included a VI of the attempt in #2 above. Disclaimer: my labview skills are minimal and this vi was very experimental so it's probably terrible form.
Solved! Go to Solution.
11-04-2010 12:27 PM
Why do you want to do this. Many modern sound cards have 5 output channals
11-04-2010 12:37 PM
I'm required to work with a piece of hardware that is a 10-channel output device, but shows up as 5 separate sound cards. So this device actually only has two channels per sound card, and I'd like to control the sound signals (via .wav files) to the cards independently by simutaneously.
11-04-2010 03:34 PM
I got the two wave files to play overlapping to different cards, but NOT synchronous. I also tried handshaking across the two just prior to sound output via semaphores, but no luck. Perhaps it just depends on whenever labview hits that instruction.
Watching the light bulb iterate through, the loops occur simutaneously where the sound write vi is called, but the exact moment when the sound write vi's get hit are not synchronized. Oh well.
11-05-2010 11:30 AM
Tzoom84,
Since there is no way to buffer your sound output on the sound card and use hardware triggering you will be limited to software start timing. You could use semaphores as you said, or simply wire both of the Sound Output writes in parallel inside a single while loop. Since windows is nondeterministic the best you will likely achieve is the two outputs starting within tens of milliseconds of one another. The time between the two starting will be affected by all other processes running on your system and may take much longer.
Regards,
Sam K
Applications Engineer
National Instruments