11-09-2021 09:15 AM
Does the bin file is ok or not? Anyway, you are reading a single word from it. Use count = -1 to read the whole file.
Side note: you don't need to close the file and reopen, just use Set File Position to rewind the binary file.
11-09-2021 09:20 AM
The bin file is fine, just not sure why it won't create / overwrite a new wav file. How would I read the binary file after stop is pressed and then write a new wav file instead of overwriting the bin?
Thanks for the reply.
11-09-2021 09:31 AM
Have you put an error handler after on your error out for the file like you did for the other error wire? I'm guessing there's an error you're not aware of.
11-09-2021 09:40 AM
The attached is finally creating a .wav file and looks to have some data in it but when playing it in Audacity it shows no waveform. Any clues as to what I am missing.
Again, thanks for all the help and replies.
11-09-2021 09:46 AM
You may have to "resample" it as a standard .wav file format. Maybe Audacity doesn't consider it a .wav file.
11-09-2021 09:59 AM
Do you mind showing how I would do that?
11-09-2021 10:39 AM - edited 11-09-2021 10:40 AM
Well, according to your VI, you sampled at 0.0002 seconds, or 5 kHz which is not a standard .wav format. Resampling at 44.1 kHz before writing the sound file should do the trick. (There are other rates you could use, but that one is most common.) LabVIEW has some resampling VIs to help you, but I'm actually not exactly sure which one you should be using. There are examples for each of them included in LabVIEW.
11-09-2021 12:08 PM
Hi,
I am attempting to write a .wav file from a .bin file in my VI after the stop button is pressed. Currently when I do this, the .wav file is created and seems to have data being stored to the file (because the file size increases) but when I attempt to play the file in Audacity there is no signal. My bin file has the correct audio data saved to it. The .bin file and the .wav file show the same file size as well.
What am I doing wrong?
Thanks for any help.
11-09-2021 01:11 PM - edited 11-09-2021 01:23 PM
Hi LKcire,
please stop creating new threads for the very same problem! Keep related things/VIs in just one thread/discussion!
(I merged your threads…)
Why don't you divide your complete VI into several sub-problems?
Why not investigate the WAV-file generation on its own?
See this:

It works for me as expected: a WAV file is generated, with the content I expect to be written…
Two notes:
11-09-2021 01:29 PM
Sorry for the multi-threads.
You don't think it would have anything to do with how I am trying to read from the binary file do you?
If LabVIEW does not handle my U16 data well, how would I get around this to make sure that isn't the issue?
The wave file is created and the file size increases so I assume has "data" in it but when playing it through Audacity there is no waveform.