Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

myDAQ audio pass through on daqmx

Hi There,

 

I tested the analog in/out connection from NI myDAQ, I used the audio pass though code that appears on the manual using daq assistant (passThroughAI.vi). This works pretty well, but I wanted to dig a bit further so I can get used to code with daqmx. So i had some attempts writing using channels (analogIN_OUT_channels.vi), using tasks (Pass Audio-In to Audio-Out_task.vi). Even when I use the same values of sample rate and samples to read, I just get  a very glitchy sound.

 

If you could please point any mistakes,any relevant material or any suggestion so I can solve this issue....so far, I can't really see what I'm missing :s

 

Note: The above mentioned files are contained in the zip file "test.zip", the server did not allow me to upload any of them by separate :s

 

Thanks in advance,

Jose Vidal

0 Kudos
Message 1 of 5
(5,937 Views)

Usually the easiest way to transition between DAQ Assistant and DAQmx calls is to right-click on the DAQ Assistant and choose to replace it with the DAQmx code.  It will show you what it was abstracting.  This is a good way to get an idea of what was working and you can use that to determine what's different between that code and your attempt.

0 Kudos
Message 2 of 5
(5,919 Views)

Thanks for your reply natasftw.

 

I forgot to mention,  I have already tried that route...but it  generates lots of unnecessary code. That if I try to troubleshoot using the task model, then I end up with some code pretty close to the one I have attached.

 

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

Hey joseVidal,

 

Had a look at your code, and in your (analogIN_OUT_channels.vi) you have your sample rate set at 44000, and your samples per channel set at 10000. This means that your audio is refreshing at 4.4Hz. If you decrease your samples per channel to 1000, and try again, this should improve your glitchy sound. Let me know how that goes.

 

 

0 Kudos
Message 4 of 5
(5,901 Views)

Thanks for your reply 01635517396,

 

 

I have already tried to do that, but it does not help very much. But, if you see the code the configuration I used for the asistant...it works just fine. So, I am assuming that is not related with the sampling rate, but perhaps I'm missing some property nodes or or some other code. Otherwise, I can't explain why works with the assistant and saame configuration.

 

Please If you have any suggestion, please let me know.

0 Kudos
Message 5 of 5
(5,881 Views)