LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text to .wav file

I am trying to convert the text data to .wav form. I am not sure,if this is the proper way to do it.

 

 

0 Kudos
Message 1 of 9
(4,500 Views)

Only if the numbers are written in hex form, if you can read them you need to convert them. Check out Text to decimal number.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 9
(4,478 Views)

Hi kulsman,

 


I am not sure,if this is the proper way to do it.


 

You can hear that afterwards - just try it! 😄

 

Btw. it doesn't look "right" when you convert a text to U8 array followed by conversion to DBL array followed by a CoercionDot...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 9
(4,474 Views)

I think my values are in hex. Please the attached text file.

 

I have tried to play the output, there is just some static noise....

 

 

 

0 Kudos
Message 4 of 9
(4,445 Views)

Hi kulsman,

 

when I rename your songtext.txt to songtext.wav I can hear the (classic quote) words "What is thy bidding, my MASTER!"...

 

The file is already a WAV file so you can read it using the Wave sound reading VI. No need to read as txt and no need to convert in any kind...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(4,440 Views)

Yeah, the header of the file got me thinking in that direction also, but i got an error when renaming and opening the file. 😕

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(4,435 Views)

Unfortunenately, the decryption algorithm needs a text file, so I have to use the text file.

 

It is interesting that by changing the extension that you are able to play the song. Could it be possible to do the same in labview?

0 Kudos
Message 7 of 9
(4,430 Views)

Hi kulsman,

 

I can load and play the file using simple LabVIEW functiosn from Audio palette:

check.png

In LabVIEW the sample rate is wrong (at least in this quick try), but maybe the file is mangled in a weird way...

 


Unfortunenately, the decryption algorithm needs a text file, so I have to use the text file.


 

No, you don't THINK DATAFLOW!

The algorithm expects DATA formatted as string. You can read any file as plain string (which is just an array of U8) regardless of the file format or it's intentions...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(4,398 Views)

Hello GerdW,

 

Sorry for the late response. I have been out of state for a couple days, but I came back now.

 

It seems like I could get it to play properly setting the sound format:

 

Sample Rate:

10,000

number of channels:

2

bit per sample:

8

 

 

 

0 Kudos
Message 9 of 9
(4,360 Views)