LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

interactive play sound file.vi crashs labview

While playing with a *.wav file to perform an FFT on the data, I tried running this VI. Labview then crashes. No error.

0 Kudos
Message 1 of 10
(3,815 Views)

What kind of machine are you using?  Can you describe how you obtain the wav file, and if you can play it in windows normally.

 

I found in the documentation that the "Play Sound File" VI requires DirectX 8.0 or later and on Linux you need the Open Sound System (OSS) driver installed.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvpict/playsoundfile/

Systems Engineer
SISU
0 Kudos
Message 2 of 10
(3,798 Views)

Dell Precision T3500

Win7

NI example finder

File works fine in other VI's. This one crashes.

0 Kudos
Message 3 of 10
(3,795 Views)

Which version of LabVIEW are you using?  I'm using LabVIEW 2011 SP1, and I ran the "Interactive Play Sound File.vi" from the example finder and the VI worked for me.  

 

Are you just trying to play a sound file in your own VI?  If so, the DLL library call from the example could be causing the crash.  It could also be that your program isn't crashing, but just terminating before your sound file has a chance to play.

 

There is an easier way to play a sound file, just use the "Play Sound File.vi".  You may also need to use the "Sound Output Wait.vi" to prevent your LabVIEW program from terminating before the sound has a chance to play.  I've attached a picture of the setup I'm refering to.

 

sound_snippet.png

 

Systems Engineer
SISU
0 Kudos
Message 4 of 10
(3,786 Views)

2011 SP1

 

No, I was trying to extract the wave form as a matrix so I could run an FFT on the waveform.

 

Similar to Octave3.6.2 wavread() function.

 

 

0 Kudos
Message 5 of 10
(3,781 Views)

Oh, ok.  I found this forum post that has code on how to extract the waveform data from a wav file:

 

http://forums.ni.com/t5/LabVIEW/Audio-File-Wav-Filtering/m-p/1949637

 

You'll want to use the "Sound File Read.vi" or "Sound File Read Simple.vi".  The output from these VIs is an array of waveform data.

Systems Engineer
SISU
0 Kudos
Message 6 of 10
(3,777 Views)

That is all well and fine. I have found other ways of manipulating the data.

 

The original intent of the post was to make someone aware of a bug in the example vi.

 

That's all.

0 Kudos
Message 7 of 10
(3,775 Views)

Oh, I'm sorry I misunderstood your intent.

 

I opened the example from the example finder and was unable to reproduce the crash.  What steps do you take that causes the error?

Systems Engineer
SISU
0 Kudos
Message 8 of 10
(3,772 Views)

Labview>>Find Examples

 

Search for WAV

 

Select Interactive Play Sound File.vi

 

Run Vi>> Select sound file.

 

VI then crashes.

 

I turned on highlight execution, it crashes at, "Call Library Function Node"

 

Could it be that it's because I am on a 64bit system and LV is running the 32 bit version?

0 Kudos
Message 9 of 10
(3,769 Views)

That could be the problem, from what you described its just an error in trying to find and load the DLL.  In those cases, it does cause LabVIEW to crash.

Systems Engineer
SISU
0 Kudos
Message 10 of 10
(3,767 Views)