LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to generate wave file using snd write wave file

Hi,
I need to generate different freq wave file and save to hard drive. I tried to use snd write wave file but It did not work as expected. It creates a file but it does not play. I think its amplitude issue where I need to convert A/D values??
Does anybody has any sample program for snd write wave file I can look at?

Thanks.
Sheetal
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 1 of 4
(2,753 Views)
Sheetal,

I don't know what HW you have...or what version of LV you have...but here is an example I programmed for an NI-4772 with LV 7.1.1(revert saved to 7). I also added a filter in this that chops off above ~2.5kHz...which is above the upper-range of the human voice. You may want to change the filter settings or remove all together.

Regards,
Brett Burger
Applications Engineer
National Instruments

PS: Ths code is still kindof "in work"...I just wanted to get it out there..so excuse me if it is not fully refactored and concise.
0 Kudos
Message 2 of 4
(2,739 Views)

I should have mentioned that it should also work with an M/E series....you will just have to point the program to the correct device and channel.

-Brett
0 Kudos
Message 3 of 4
(2,738 Views)
Sheetal,

If you happen to be doing this entirely in software (e.g. generate a sine wave and save it to a wav file), then you might take a look at a shipping example entitled Sim Phone.vi (open Example Finder from Help >> Find Examples and search for "phone").

That example doesn't save anything, but I made a modified version a while ago that records the keypad sequence to file (attached; LV 7.1). It might also be instructional because I switched things from 8-bit (the shipping example) to 16-bit format for my example, so you can see some of the issues related to amplitude and using the appropriate inputs to the sound VIs.

Regards,
John
0 Kudos
Message 4 of 4
(2,735 Views)