LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a whole signal to *.wav

Solved!
Go to solution

I am trying to save a sound in *.wav generated by sine function. I am having trouble saving the whole signal, I can only get 1 second of the sound - I am kind of new to this one so I have I am struggling to get this work.

Because of the write to wav does not allow to append (I guess I might need to use another way to save the information), I put out side of the loop so the file only save one the loop is completed. I need to figure out a way to get all the information in the queue so I use Mathscript  

 

 

 

11-9-2013 11-26-29 AM.jpg

0 Kudos
Message 1 of 5
(3,381 Views)

I'm not entirely sure what you are trying to do, but I am sure that the mathscript node is not the way you want to do it.

 

Are you trying to append a waveform to itself to make it last twice as long?

 

If so, use Build Array with Concatenate Inputs set to build the array to the end of itself.

 

There is also a function called Append Waveforms that works on the waveforms directly without unbundling and rebundling.

 

 

Message 2 of 5
(3,357 Views)

I want to be able to save all of the data generated from the while loop (without losing anything), the problem is I can only save 1 second of the data. It is strange that if I use set append = True for write waveform function - I can save more but I can only get 0 out (amptitude = 0 for all values).

I attach the vi that I am acctually working on. Bascially, I generate a stream of different tones and save this stream into a wav file.

 

I tried from yesterday but I could not get it to work

0 Kudos
Message 3 of 5
(3,350 Views)
Solution
Accepted by muahang1234

Your lower while loop has a tunnel which will only output the data from the last iteration.

 

What you need to do is append data, but put the waveform into a shift register so that it is available for the next iteration to be able to append more data to it.

Message 4 of 5
(3,335 Views)
I used the first loop with queue (I learn about the queue concept last night) to write the data. I put the shift register and the append function to get the whole information. I might missunderstand some concepts.
0 Kudos
Message 5 of 5
(3,324 Views)