From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to get live playback of audio input?

Solved!
Go to solution

I know it must be simpler than I am making it, but somehow I just can't seem to get it to work right.  I am using a myDAQ taking in analog voltage data and wanting to play it back (with some filtering) either through its onboard audio out jack or through my computer.  I seem to not understand exactly how the DAQmx voltage output is supposed to work; using anything other than the express VIs so far has just given me errors.  Using the express VIs, I've only been able to sample and playback delayed chunks of data, with gaps between them (not exactly ideal).

 

Getting some sample code could help greatly in understanding how this process should work, and would probably be helpful to many other people as well.  Thanks.

0 Kudos
Message 1 of 4
(2,778 Views)

Have you looked at the shipping examples?  Check out Help > Find Examples... Hardware In and Out > DAQmx > Analog Input for reading in your voltage wave. 

Help > Find Examples... Hardware In and Out > Sound for playing back those waves with a sound card.  You'll have to cobble together the Input code and Output code to make a continuous sound recorder/player, then add your filtering between them.  Those examples all use the DAQ and Sound primitives so you won't be hobbled by the lame Express VIs.

 

What is your sound source?  You will need an external amplifier if you're using a microphone to get a decent single range for your DAQ.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 2 of 4
(2,759 Views)
Solution
Accepted by topic author ColinL

I think this example does exactly what you want.  It takes in analog input from the myDAQ, then has the option to add a filter, and then output it back.  I don't remember where I found it but it was in some workshop for learning how to use the myDAQ and LabVIEW.

Message 3 of 4
(2,754 Views)

The given example did exactly what I needed it to.  I had set up my code almost identical to this, but apparently had some setting mismatch between the input and output express VIs.

0 Kudos
Message 4 of 4
(2,725 Views)