Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB 9229 -> audio samples -> write to wav file: problems!

Hello all,

I am acquiring audio samples with a NI USB 9229 (at 50kHz) and I'd like to write these to a wav file. The problem is, the sound files I am generating are the correct length, but they only have some buzzing noises inside them. I tried normalising the samples I am reading from the NI (and which generally are between +/- 0.6V) to values expected by the wav format (0..255), but no success.

I have seen many posts in the forums suggesting the use of a sound .vi for writing wav files (for instance this: http://zone.ni.com/reference/en-XX/help/371361B-01/lvpict/sfilewrite/), but I am using the NIDAQmx library under Visual C++, so that is not an option. Perhaps someone can describe what the .vi is doing with the samples read from the NI card so that I can replicate this in c++ code?

Or does anyone have any experiences with such a situation?

 

Thank you for any suggestion!
--Cristina.

0 Kudos
Message 1 of 4
(3,191 Views)
The NI 9229 has a ±60V input range.  This is really not ideal for reading a 0.6V signal.  The accuracy of this device is going to be about ±5 mV (±8% of a 0.6V signal) based on the specifications.  The end result will be a noisy signal even if you get it to write to the file correctly.  For sound applications in this range, I'd recommend the NI 9234.
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 4
(3,178 Views)

Hi Seth, thanks for your feedback! Someone else on the forum was helpful enough to point this out as answer to a previous post of mine.

Unfortunately, our client insists on acquiring audio with this and some other, similarly ill-suited cards, so one way or the other I must use it 🙂

 

I've felt the input range problem already: I am using an iPod or similar devices connected to the card, and even at maximum volume I get sample values of at most +/- 0.6V. It's just our bad luck that it's not 100% impossible to read audio with this card, otherwise we could perhaps convince our client to use more suitable cards 😄

 

But thanks a lot for taking the time to answer!

0 Kudos
Message 3 of 4
(3,176 Views)
One thing you might try is some manner of amplifier circuitry.  If you could even get the signal up to 10V, you'd have better luck.  If you could do a 100X amplifier, you'd be able to use your full range and get very good accuracy.  At this point, you'd want to watch out and make sure it wouldn't shock anyone, but you'd get much better readings.
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 4
(3,169 Views)