LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording simulated signal as a wave file

Solved!
Go to solution

Hi

 

Im trying to record a simulated signal(later it will be a be a signal from a USB-6008) and then save it to a .wav file with the user specified lenght. So what i want to achieve is to let the user press a button when the recording should start and let him press the button again to stop the recording and store those recorded data with that lenght of the recording to a wave file.

It appears that i do get some kind of data saved to my .wav file as it has a a variable lenght when i do a playback in a mediaplayer, but theres just no sounds at all. If i check the data in the array it seems correct but im not sure about the arraysize compared to how long time i choose to do a recording.

 

If anyone has an idea to a solution its greatly appreciated.

 

Thanks in advance

Dennis

 

 

0 Kudos
Message 1 of 4
(3,110 Views)
Take a look at this example "Sound Input to File.vi". You can find it with find example under the help toolbar.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 4
(3,094 Views)
One of the problems with that example is that it should later be running on a PDA so im limited to the Mobile Module functions for writing to a wave file which is the "Snd Write Wave File.vi" so that example can't be applied to my problem.
0 Kudos
Message 3 of 4
(3,071 Views)
Solution
Accepted by topic author Dennis Francek

Hi

First of all you should have mentioned that you were developing for PDA. You should also pay more attention to details. Your "Snd Write Wave File VI" expects a I8 or I16 input. A I 16 input has a range from –32,768 to 32,767 and no decimal digits. So if you just tie a floating point sinus wave with amplitude equal 1 to a I16 integer it will be converted to a square wave swinging from -1 to 1. Such a signal will drown completely in the soundcard internal noise. And the sound of silence will be the result, then you listen to your wave file. Also if you are going to do some real world data collection. The way the "Snd Write Wave File VI" writes data to file I highly inefficient. But this is not your fault. Your program structure is also consumes a lot of memory. It is perhaps not suited for implementing on a PDA. But as a tool for testing only, on a PC it is OK.

The "Snd Write Wave File VI" is very simple so you can rewrite it for better performance. Just remember to save it as a new file before you starts working on it. Then you collect data from your USB-6008 you should also read it as a I16 stream. This way you can plug the data directly into your write wav file function

If you have some questions post it 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 4 of 4
(3,062 Views)