LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert saved binary file to .wav file

Hello,

 

I have a VI that is displaying some audio data on a graph that I am also saving to a .bin file.  What I really need is this data in a .wav file format.  Is there a way to convert the saved binary data to a .wav file when I am finished displaying the data on the graph (like when the stop button is pressed.. or a save button)?

 

I have attached my VI for reference.  I appreciate any help with this.
Thanks,


0 Kudos
Message 1 of 27
(6,430 Views)

Read back the binary data, add the stuff necessary to make it a waveform, then use Sound File Write VI billko_0-1636389910908.png to write to wave file.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 27
(6,419 Views)

where would I do that?  Outside of the while loop attached to a save button?

0 Kudos
Message 3 of 27
(6,415 Views)

Hi LKcire,

 


@LKcire wrote:

where would I do that?  Outside of the while loop … ?


Yes!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 27
(6,395 Views)

What am I doing wrong here??  I don't even see an empty .wav file created.. Sorry just confused here.

Thanks

0 Kudos
Message 5 of 27
(6,386 Views)

Hi LKcire,

 


@LKcire wrote:

What am I doing wrong here??


Your "U16" numeric constant actually is a I32…

 


@LKcire wrote:

I don't even see an empty .wav file created..


Are there any errors upstream? Did you debug your VI using probes and execution highlighting?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 27
(6,383 Views)

No errors upstream.  Should this overwrite my .bin file with a .wav file or create a .wav file of the same name?

0 Kudos
Message 7 of 27
(6,381 Views)

Hi LKcire,

 


@LKcire wrote:

No errors upstream.  Should this overwrite my .bin file with a .wav file or create a .wav file of the same name?


Yes, it overwrites (or it should) because I never change the filepath.

I made this image just for suggestion: you need to implement some error handling and add some filepath manipulation when you want to convert to a different filename!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 27
(6,376 Views)

appreciate the image, I don't need to convert to a different filename so this is fine but it is not overwriting.  It really doesn't seem to be doing anything which is why I'm stuck...

I can't import your image to see if I missed something because I have LabVIEW 2016 and it won't let me.  

Again, thanks for your help.

0 Kudos
Message 9 of 27
(6,373 Views)

Hi,

 

I have a VI that plots a portion of a data frame (2 bytes of audio) on a graph.  I am also saving these 2 bytes to a .bin file, but would like to convert the bin file to a .wav file when pressing the stop button.

 

I think I want to read the bin file, build a "waveform" and then write it using the sound file simple write.  I am not doing something right because this doesn't even create or overwrite the bin file to an empty .wav file.  Nothing seems to be happening and I'm not sure where I'm going wrong.
Thanks for any help in advance.

 

 

0 Kudos
Message 10 of 27
(6,355 Views)