LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Sound Cards

I have two sound cards in my computer and I want to use them both to output sound at the same time independent of each other.  My problem is that I am only hearing audio out on the sound card that is selected in Windows XP as the default sound output.  The other sound card is silent.  If I change the default sound device to the previously silent card it now becomes audible and the other one goes silent.  Labview 7.1 does recognized that there are two sound cards, one on Device 0 and the other on Device 1 but no matter which one I pick the windows default sound card outputs the sound.  I do not get any errors and the program thinks it is doing what it is supposed to.

 

 I thought this may be an operation system problem and not a Labview problem but others applications can use the two sound cards independently just fine.  Windows Media player will output sound on whatever card I tell it to and the same with Winamp.  I can even output different wave files on the two sound cards at the same time.  So I know it can be done but why not in Labview?

 

Thanks to anyone who can help.

 

I would forget about the second sound card if I could control in real time the mixing of two or more wave files with independent volume control of the left and right channels of each wave file. What is the best way to do that?  

 

 

 

0 Kudos
Message 1 of 3
(2,885 Views)
Hi,

It's hard to say what the cause is of your problem.  It may be that LabVIEW is looking at the default sound card in your system and ignores the rest.  This may happen if you are using the Play sound VIs.

The way to achieve two outputsis by opening up the WAV file and use the Snd Write Waveform VI. One of the inputs for this VI is the device number. Usually they start at 0 and increment by one. You can have a VI where you open the 2 files and then use 2 write waveform vis using different device numbers.

You can get all the information about the soundcards by calling the Windows SDK, however this can take some work and may be easier to do it in a DLL.


Are you using the Sound and Vibration Toolkit?  If so what version?  What sound cards are you using and what version of Windows are you using?


Regards,

Nadim
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(2,871 Views)

Thanks,  I already figured out the problem and it was like you said.  The Snd Play Wave File.vi will not work with anything but the Windows default sound card.  The problem is that it does not say that anywhere.  Must be a bug.  The SO Write and SO Play VI's work fine with whatever sound card you pick.

0 Kudos
Message 3 of 3
(2,865 Views)