05-19-2010 07:30 AM - edited 05-19-2010 07:32 AM
Hi,
I appreciate that this topic has been discussed several times before in this forum, but I am unable to find any answers that help me as yet.
I need to do the opposite of what the Simultaneous Sound IO example VI does. The example acquires audio from the input, and plays it out of the output. I need to send synthesized data to the output of my sound card, whilst at exactly the same time acquiring data from my sound card's input.
I've made a VI that does this, based on the example VI, but it doesn't seem to work quite right. The VI creates a sine wave, splits it into chunks, and send the chunks (the size of which is specified as a buffer size) one by one to the output. This works fine and smoothly in real time if the buffer size is set right. At the same time it acquires data in the same size chunks from the input, and saves them to an array. And it all seems fine.
However, if I use a loudspeaker and microphone for output and input respectively, and face them opposite each other so that I am now acquiring the whole system's response to a the sine wave, then a delay is visible as the start of the acquired waveform before the sine wave, as if the sine wave didn't start playing until some time after the acquisition started. This delay is definitely longer than the time taken for the sound to travel from the loudspeaker to the microphone.
Is there a way to synchronise precisely when two VIs execute? I need to be sure the acquisition and output happen at exactly the same time.
I've attached my VI.
Thanks,
Christian
05-19-2010 09:18 AM