LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a wav file from 24bit 96Khz sampling rate data

Hi

I am trying to make an VI which will play sound while acquiring data from PXI 4472 DAQ card.
My sampling rate is 96Khz and PXI 4472 card is a 24bit card.
Wave files are in 8 or 16 bit and the sampling rate is 8000, 11025, 22050 and 44100. How will I be able to play the data which I am acquiring.
How would i normalize the data into the required format needed for most of the sound cards to play.
Or are there any codec available in Windows XP which i call to play a 96KHz 24 bit sample

Does anybody ever encountered this type of problem.

Thanks in advance

Nitin

0 Kudos
Message 1 of 7
(4,319 Views)
do you have a 24 bit soundcard in your system??
0 Kudos
Message 2 of 7
(4,313 Views)

No I dont have a 24 bit sound card on my system

 

0 Kudos
Message 3 of 7
(4,307 Views)
Hello,
 
It looks like you're going to have to reduce your sampling rate, or decimate the resulting array of data (you can pull just the array of data using the Get Waveform Component" function in the waveform palette, so that you match the rates that the wav file uses.  Further, your data has more precision that the wav file data uses, so you can convert your values from double to I16.  I don't know of any codec that will play a 96KHz 24 bit sample.  For general programming with the sound VIs, you should check out the shipping examples (see Help -> Find Examples... in LabVIEW, and you can search the keyword sound in that application under the search tab).
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
Message 4 of 7
(4,293 Views)
Whilst the 'standard' RIFF format specification usually accomodates 16 bit data, there is of course no reason that you can not create your own extension. It just won't be playable by Media player using the 'standard' installed drivers or codec. This may not be a problem....

WAV files can and do support other formats, you just need to know how to handle them......
There is howerver a 4GB limit (related to the pointer size in the WAV specification) which with higher bit depths on the sampling does start to become a bit of a problem.

To give you a few samples of other types of wav files check out the following site here
http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html

The following definitions for WAV audio formats may also be of interest here
http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html

Good luck with 24 bits. Smiley Wink
Message 5 of 7
(4,280 Views)
One thing you might try is the Resample Waveform function that's on the Analyze>Waveform Conditioning palette. This should convert your 96Khz sampling to one that the sound card can handle and make the frequency of the sound correct. There's a shipping example called Resampling Wave File Player that uses this. To handle the amplitude, you can just convert that to I16 as JLS mentioned. Do you know what the max amplitude the DAQ card will detect? You may have to scale this before the conversion to I16.
Message 6 of 7
(4,280 Views)
Hi Guys,

Thank you all for your responses. Every reply gave me a nice insight to how sound is played and How to play with the data. I was able to resolve the issue I had with my VI and now it works fine

Thank you once again

Nitin
Message 7 of 7
(4,259 Views)