04-15-2009 08:46 AM
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
Solved! Go to Solution.
04-15-2009 11:37 AM
04-16-2009 02:38 AM
04-16-2009 03:47 AM
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