LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a wav file produces nothing??

Works for me, what are you using for your input values to the VI?
0 Kudos
Message 11 of 17
(1,191 Views)
Of course, if you don't have automatic error handling enabled and specify an invalid filename, no file is created and you will receive no notification of the error.
0 Kudos
Message 12 of 17
(1,190 Views)

I do have a path set, duration(s)=20, f(Hz)=440, and fs(Hz)=20000.

 

It does write a wave file, but it has no data inside (checked with matlab..).  Another thing:  when I set different durations, the size of the file doesn't increase.

 

Here is info header that I pulled off the saved wav file:

56 bytes (0.05KB)
2008-12-13 00:12:12

RIFF 'WAVE'
 <fmt > format description
  PCM format
  2 channel
  20000 Hz
  80000 bytes/sec
  4 bytes/frame
  16 bit
 <fact> waveform length
  0 samples
 <data> waveform data

 

Any thoughts?  Thanks so much for your time.

0 Kudos
Message 13 of 17
(1,181 Views)
I should also add that looking at the indicators in the .vi file, they do show that there is data being produced.  I do hear the tone and noise in the play waveform express function.  The problem just seems to be with writing out the wav file....
0 Kudos
Message 14 of 17
(1,178 Views)
Did you try reading your file with LabVIEW's Sound File Read Simple.vi?  I see data in my wav file.  Perhaps Matlab is not reading the file in correctly.  You may wish to try using a standard wav sampling rate, such as 22050 and see if Matlab likes it or not.  Have you tried to play the wav file on your PC?  I can easily hear the data on my PC.
Message Edited by Matthew Kelton on 12-12-2008 07:26 PM
0 Kudos
Message 15 of 17
(1,177 Views)
If you can hear dat when you play the wav file on your PC (not while LabVIEW is creating the file, but with Media Player), the wav file is produced correctly and Matlab is the problem.
0 Kudos
Message 16 of 17
(1,175 Views)
There is a huge difference between an empty file and a file that some other program cannot process. It would have helped immensely if you had simply checked to see if the file is actually empty and provided that information in your original post. Simply looking at the file properties in windows explorer and seeing the file size would have sufficed to determine that the file was not actually empty.
Message 17 of 17
(1,151 Views)