LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data in *.wav format

First of all, LabView is very new to me. I an trying to find a vi that allows me to connect an array (double orange lines) to the'SND WRITE WAVE FILE' vi which requires a maroon colored line. What do I need to do?
0 Kudos
Message 1 of 6
(2,977 Views)
What is the actual maroon coloured line saying when you hover your wiring tool over it? There isn't as far as i can see a maroon line...there is a brown one which says sound format. This is a cluster of 3 x U16 controls.

Probably the easiest thing to do would be to send me your vi or an example of it, and indicate on the diagram what you want to do and what you want to wire to what.

I look forward to hearing from you..

Kim
0 Kudos
Message 2 of 6
(2,977 Views)
Hi,
This VI has a set of inputs
1. File path (top-left) - it looks liked dirty-green and corresponds to the name of file
2. Sound Format (center-left) - this input specifies the format of the sound (mono/stereo, frequency, # of bits). This id cluster and you have to enter all its elements.
3. The set of inputs (top and bottom) corresponding to your 2D arrays of data. You have to use one of them depending on sound format.

Everything is easy. If you have problems right-click on the VI on diagram and select "Help" from pop0up menu and you will get all the info about this VI.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 6
(2,977 Views)
The "maroon" data you are speaking of is the sound format. This is a cluster which must agree with the type of sound you are trying to record.

A few things you should know before trying to record a wave file:

The type of wave file must be known. This is either 8 bit mono, 8 bit stereo, 16 bit mono, or 16 bit stereo. You have a 2D array, which indicates stereo. The 8 or 16 bit selection is then a matter of the levels of your array (amplitude). If the values are in the range of -127 to 127, then you have an 8 bit array. If they are between -32687 and 32687, then you have a 16 bit array. If they are somewhere in between, you will have to scale them, otherwise, you risk the volume being too low.

In order to input your array, you have to convert
it to an integer. In the math palette, you will find a conversion sub palette. Just drop in a U8 or U16 between your array and the appropriate input, and you will be set.

Again, depending upon your data, you will need either 8 or 16 bit stereo, and you have to put that in the Sound Format cluster (constant). The bottom variable is for the sample rate, which again, depends on your data.

Good luck.
0 Kudos
Message 4 of 6
(2,977 Views)
The sound formant was the one i was refering to, but I later discovered that I needed to connect myt array to the blue 16 bit stereo input. I was confused because the there was no orange input. I know it was a pretty dumb question, but again I am new to LabView. I am now able to generate a wav file, but I have to figure out how to make it record longer than a fraction of a second. Too bad I wasn't the one to write this program that I want to modify. I Thank you for your help.
0 Kudos
Message 5 of 6
(2,977 Views)
I'm glad you have sorted out the file saving now. I had a quick look at the Snd Read Waveform vi which you may be using to sample the sound. I'm not sure, but wondering if you increase the buffer size you may be able to record longer. I guess it's worth a try.

Good luck with it, and dont be worried about asking questions...it's better to ask than to sit for hours pulling your hair out!

Kim
0 Kudos
Message 6 of 6
(2,977 Views)