LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert data file to audio file in Labview


@austin2017 wrote:

Thank you for ur answer. Actually my qestion is convert a txt file( i convert signal which showing in labview graph to txt file )which include numbers convert to sound file or just signal convert to audio file in labview.  Is that possible?

thank yiu


Well... you're the one who encoded it.  I suppose it's up to you to decode it now.  If all you did was convert the raw values into human-readable text, there's no reason you can't reverse the process.  It should be as simple as reading all the values into a byte array and writing it to a file.  Read up on what a wave file header is if you want audio players to know what to do with it.

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 11 of 19
(2,380 Views)

yes. I checked the Sound palette that was mentioned earlier. all the example are read sound file and write sound file.  I tried to read txt file write to sound file, and  then I tried directly read the input signal and write to sound file. but both failed, the program can not run.

0 Kudos
Message 12 of 19
(2,374 Views)

So you've got step 1 and step 3 of what I wrote done.

 

Sounds like you forgot to do step 2.

0 Kudos
Message 13 of 19
(2,372 Views)

I have waveform . Sorry i did not mentioned that

0 Kudos
Message 14 of 19
(2,370 Views)

Then send the waveform to the VI I told you about.

 

If you are still having problems, we can't help without seeing your code.  Attach a VI.

0 Kudos
Message 15 of 19
(2,367 Views)

sorry. I am a beginner . I attached labview file.  the input is a signal from data acquisition. I want to write it to sound file.

0 Kudos
Message 16 of 19
(2,362 Views)

the waveform lokk like the attached picture

0 Kudos
Message 17 of 19
(2,358 Views)

Is there a reason you are saving the data as an excel file?  It would be a lot easier if you just saved it directly, without making any kind of intermediate file.  According to your waveform though, you may have clipping, since it seems you will have numbers outside the range of +/- 1.0.

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 18 of 19
(2,353 Views)

@austin2017 wrote:

sorry. I am a beginner . I attached labview file.  the input is a signal from data acquisition. I want to write it to sound file.


When I open your VI, I see a broken run arrow.  So to figure out what is wrong, I click on it.  It gives me a list of all the errors.  Then I read it and fix the problems.

 

Did you do that?

 

I see one error about the Sound Write .VI missing a required input.

 

If you open context help and hover over that VI, it will show you which inputs are required.  (The terminal is shown in bold.)  You can open detailed help and learn even more about that function, VI.  In this case, your Sound refnum needs to be wired.

0 Kudos
Message 19 of 19
(2,348 Views)