LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

play .wav file

Hello all.

 

I am trying to play a .wav file to indicate to the user my program is done.  I put a control on the front panel to allow the user to select the file to play.  The problem is that it works with some .wav files but not all.  I have a small collection with a star trek theme, but it only plays one out of the bunch.  Any ideas?

 

Mike

Mike
0 Kudos
Message 1 of 12
(5,003 Views)

It's hard to say without seeing your code, but maybe it has something to do with the resolution or sample rate of your .wav files? 

 

Can you verify the sample rate and resolution of the file that works against the ones that aren't working?

 

Also, how are you playing these? With the Play Waveform express vi?

0 Kudos
Message 2 of 12
(5,000 Views)

Maybe this will work?

 

play wav files.png

0 Kudos
Message 3 of 12
(4,994 Views)

I used the Sound File Info vi to pull up some information on the files that don't play.  specifically the Samples per channel and bits per sample are zero on those files.  The interesting thing about is that media player will play them, but LabVIEW won't. 

 

So is the solution to find better wave files?

Mike
0 Kudos
Message 4 of 12
(4,980 Views)

Maybe... Can you post one of the .wav files? I could give it a try if you want.

0 Kudos
Message 5 of 12
(4,976 Views)

I think I got this figured out ......

 

Thanks

 

Mike

Mike
0 Kudos
Message 6 of 12
(4,967 Views)

Maybe you have a compressed wav file? Try this: http://forums.ni.com/t5/LabVIEW/play-sound-file/td-p/715538/page/2  The first post from Jared_B on the second page is what I'm referring to.

0 Kudos
Message 7 of 12
(4,965 Views)

It looks like your wav files are compressed. I tried converting beep05.wav with the instructions in the link I previously posted. Now it works. I bet that's all it is. Good luck.

0 Kudos
Message 8 of 12
(4,963 Views)

Could be, but your trick worked.  Thanks 

 

🙂

Mike

Mike
0 Kudos
Message 9 of 12
(4,958 Views)

The wav file header is wrong. Take a look here

https://ccrma.stanford.edu/courses/422/projects/WaveFormat/



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 12
(4,946 Views)