LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.wav file to visual representation

I am attempting to use labview to take a .WAV file and analyze it in labview.

From there, I need to detect specific frequencies and when those frequencies are present, I need it to light up an LED on the front panel.

I have programmed a working .WAV player and am attempting to use the wave file to wave form VI to turn the .WAV into data that labview can use.

The output of the wave file to wave form VI is running to a spectral analyzer, however, when I run the program, the wire rom the wave file to wave form VI is never highlighted and the program locks up.

Does anyone know what I am doing wrong and how to fix this?

Thanks!
John
texas.dough.boy@gmail.com
0 Kudos
Message 1 of 7
(4,548 Views)
John, you should have no problems to analyze a .wav file in Labview.
It is not too clear what your problem is, so ,please, post your vi.
Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 2 of 7
(4,538 Views)
How do I post my .vi?
0 Kudos
Message 3 of 7
(4,536 Views)
that is quite easy. when posting, scroll down and you will see Attachement.

Browse your disk to your vi, select it and submit post

Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 4 of 7
(4,532 Views)
Thanks!

Here's what we have. The issue we're having is that the graphs don't display in real time and when we use a .wav file longer than about 10 seconds, the entire program locks up.

I suspect that the .wav file to waveform vi is taking the entire .wav file and converting it to an array before outputting it to the graphs and when the .wav file is too long, the array gets too large for the .vi to process.

(Am I accurate in taht assessment?)

And, how would we go about getting the graphs to display as the file plays and being able to use a longer .wav file?
0 Kudos
Message 5 of 7
(4,514 Views)
One last thing... if you send me any .vi's, could you save them as version 7.0? My student edition is a little behind the curve.
0 Kudos
Message 6 of 7
(4,514 Views)
Hi John
Can´t run your vi. Missing wav to waveform.vi. but never mind!

You are rigth, NI wav read vi reads all waveform at once and this is a trouble if wav file is long.

See attached vi (7.0). It reads Wav header and allows you to read data using standard NI read vi´s.

Wire audio index to Start of read offset of "read from I16 file vi" (if 16 bits audio) and read the chunk of data you want to.
Don´t forget to use "swap bytes" to convert data.
I use a while loop to read and process chunks of audio data from very long audio files.

Hope it helps.
Post back if some doubt.
Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 7 of 7
(4,501 Views)