From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a wav file produces nothing??

Hi everyone,

 

My problem involves just writing a simple wav file that takes in 4 waveforms and puts it into an array for the wav.  I have used this: http://cnx.org/content/m14771/latest/ as a reference, but obviously I am missing something because once I finish the DAQ,  my wav file has nothing inside.  I was also recording binary files at the same time and their files had data in them.  Attached is the part of the wav collection.  I don't need the wav file to be able to play on Windows Media Player.  I just need it to be readable in matlab.  I tried changing the bits per sample to 16 as well, but the same results show up.  (Nothing! 😞  )  dt is 1/sampling frequency.  Inputs are normalized before becoming a waveform.  Does anyone know what the problem is? 

 

Thanks.  I really appreciate it.

Jud~

0 Kudos
Message 1 of 17
(3,220 Views)
I tried the same thing with just 2 channels of output into my array, just in case the wav function doesn't do more than 2 channels of data and the same thing happened.... Output=0.  😞  Anyone familiar with what's happening?
0 Kudos
Message 2 of 17
(3,200 Views)
It's pretty hard to debug an image and even with the actual vI, it would be hard to debug if someone did not have the DAQ hardware. What you can do is wire up some indicators to the arrays before they are processed. Run the VI and make sure there is data in the indicators. Go to the edit menu and select Make Current Values Default. Save the VI and post that.
Message 3 of 17
(3,188 Views)

Hi Dennis,

 

Thank you for your reply.  I did just that: put indicators everywhere and compared both the waveform output and the array output.  They are exactly the same through data acquisition.  I did make a slight change to the sampling rate and it now writes a wav file.  One step closer! Smiley Happy  I did notice that when writing the wav files, the file size kept on cycling.. from 1 to #kb and then back to 1 then repeat.  The end result is a much smaller size than the binary files I am comparing the output with.  Would anyone happen to know what is going on during this write?? 

 

Ideas are much appreciated!  Thanks,

Jud~

0 Kudos
Message 4 of 17
(3,108 Views)
Forgot to add attachments just in case!  Please help.. stuck.. Smiley Sad
Download All
0 Kudos
Message 5 of 17
(3,104 Views)
Well, those indicators show that there is no data in them so that would explain why your file is empty. As to why they are empty, I still have no idea because you have only posted a very small part of the block diagram and not the actual VI.
Message 6 of 17
(3,096 Views)

Hi Dennis,

 

The attached pictures were just to show a general idea of what I did.  Sorry for not being specific, but I took a snapshot of them after booting up LabVIEW prior to data acquisition, so there is nothing there.  However, I have visually expected that these arrays have the data that I want in them.  The wave write function now outputs something.. but as I said previously, the size is not correct for some reason.  It looks like there is some sort of buffer the rewrites data if that is even possible.  The only factor I can think of is the dt factor of creating a waveform, which I put 1/sampling frequency.  Number of bits, be 16, 24, or 32, shouldnt matter...  Is there something I am missing?


Thanks,

Jud~

0 Kudos
Message 7 of 17
(3,087 Views)
I have no idea. You have not shown how you are acquiring the data, splitting it into different arrays, doing the normalization, or anything else except the Build Waveform function.
0 Kudos
Message 8 of 17
(3,079 Views)

Here is a .vi of an example I found online..  Only stereo (2 channels), but I still get the same output: zero..  Does it work for anybody else?

 

Sorry, I am reluctant to show the file for personal reasons on the web.  Hope the example helps....  Smiley Sad

0 Kudos
Message 9 of 17
(3,032 Views)
Forgot the attachment!
0 Kudos
Message 10 of 17
(3,031 Views)