09-22-2012 01:24 PM - edited 09-22-2012 01:27 PM
Hi,
I am trying to build simple program that would sample from analog input and play it on the audio output.
I wrote the following code in C# (even though the problem exists in C either) http://pastebin.com/DeQFzkBw and when I am running it on my myDAQ I am having a delay of about 1.2 seconds!
What am I missing?
Thanks!
Lev
09-24-2012 06:33 PM
Hi levp92,
Have you looked at any of the C# examples that come with measurement studio? There are examples for analog IO there that can help you at this location: C:\Users\Public\Documents\National Instruments\MStudioVS2010\DotNET\Examples . Hope this helps!
Dayna P.
Applications Engineer
National Instruments
09-25-2012 02:19 PM
My program is based on this examples, but still has this problem.
Do you have any other suggestions?
Thanks,
Lev
09-26-2012 09:17 PM
Hi Lev,
You are currently reading chunks of 5000 samples at a time. After you sample all of the data, you are processing all of the data. Then finally you are displaying it. Sampling and processing that much data can take a lot of time, and might be the source of the delay. I recommend reducing numberofsamples down to a much smaller number, such as 5, and then running it, and then see what the delay is.
Hope this helps!
Dayna P.
Applications Engineer
National Instruments