LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write a .wav file to analog output?

I am using a PXIe-1073 Integrated MXIe daq with an analog input/output card (NI PXI-4461). I have a .wav file saved to my desktop and I want to play the the .wav file through the analog output card to drive many speakers (10+). I also want to be able to change the voltage level of the signal. I looked on a bunch of threads but none seem to provide what I am looking for.

 

I iniitally thought I had to use the DAQ Assistant to generate the signal, but then I realized there was no option of using a .wav file and changing the voltage level. I have read that I need to convert it to a TDMS file then write it to the output channel but I still don't know where the voltage change would fit in. At this point, I am just confused at which approach I need to take.

 

Any help would be much appreciated.

 

Thanks,

Connor

0 Kudos
Message 1 of 9
(6,315 Views)

Use the Sound File Read Simple function under the Graphics and Sound >> Sound >> File palette.  This reads the file and returns a waveform.  That waveform data type can be wired to a DAQmx Write function giving it single channel multisample output.  Relativly easy and there are examples shipped with LabVIEW showing each half, reading the file, or outputing a wave.

 

As for amplitude just multiply the Y component of the waveform by a multiplication factor.

0 Kudos
Message 2 of 9
(6,307 Views)
I'd love to see the link where it was recommended to save to a tdms file. That would be something to add to the rube goldberg thread.
0 Kudos
Message 3 of 9
(6,302 Views)

Alright so you are saying something like this

0 Kudos
Message 4 of 9
(6,257 Views)

Not sure if the picture sent

0 Kudos
Message 5 of 9
(6,254 Views)

My bad, here is the picture

0 Kudos
Message 6 of 9
(6,253 Views)

here is the picture, sorry for the amount of posts to get this

 

 

 

 

Analog Output.PNG

0 Kudos
Message 7 of 9
(6,250 Views)
You still have to add the configuration functions for the task - create channel, timing, etc.
0 Kudos
Message 8 of 9
(6,236 Views)

Alright, this is what I have so far. I had an error (200462) but I looked on another forum and found that I can fix it by putting "write data" twice.

 

 

Analog Output.PNG

0 Kudos
Message 9 of 9
(6,222 Views)