Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing audio through speakers using analogue output

Hi,

I have a speaker hooked up through the analogue output of my DAQ.  I would like to use DAQmx in order to generate sound through the speakers.  The sounds just needs to be simples tones and pulses so I've been trying to use waveform generation to give the sounds I want.  It's not working out correctly and I'm not sure why.  I can get the sound output vi's work but they generate sounds through the computer's internal speaker and not through the DAQ.  I was hoping someone knew how to solve this problem.

0 Kudos
Message 1 of 5
(3,289 Views)

What are you actually using? You mention DAQmx and speakers connected to a DAQ board but then you say you are using sound output functions. The sound functions use the sound card and are not all related to DAQmx.

0 Kudos
Message 2 of 5
(3,275 Views)

I'm using an NI USB-6259 DAQ.  I started using the sound output functions when I realized that they run through the sound card.  I'm now trying to use DAQmx but can't get it to work.

0 Kudos
Message 3 of 5
(3,260 Views)

The reason this may not work is because the output from the sound card through the speakers is modified significantly from the incoming data. For example a 1kHz signal entered into the data portion of the sound card VIs is not necessarily sending exactly a 1kHz analog output to the speaker. There is more than likely some kind of modulation and post processing that goes on to allow the speaker to understand the command to play at a certain level, at a certain frequency, and a certain duration. We do not have this modulation information readily available to understand the kind of processing that goes on before the signal gets to the speaker. With the DAQmx write commands and an amplitude of 1V set to 1kHz we are outputting an actual analog output wave of 1 kHz at 1V which may be different from what the device is expecting to receive, giving bad results or potentially causing damage. Therefore, we cannot determine what exactly needs to be set up in the DAQmx write to allow the speaker to properly interpret the data going out into the speaker. In order to output a particular sound frequency, it is best to use the sound VI and use the sound card because these device are made specifically to output certain frequencies to be played on a speaker device. If you need more assistance or explanations, feel free to reply and I will do my best to assist you. Thanks!  

Frank,
National Instruments
Software Group Manager
0 Kudos
Message 4 of 5
(3,248 Views)

If you are wiring speakers directly to teh output of the DAQ card, the card may not have enough current to drive the speaker. Speakers typically have an impedance of 4-16 ohms. A set of amplified speakers should probably work though.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 5
(3,236 Views)