01-08-2015 06:04 AM - edited 01-08-2015 06:13 AM
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
01-08-2015 07:43 PM
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.
01-08-2015 08:32 PM
01-09-2015 04:38 AM
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.
01-09-2015 08:35 PM
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.