LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding delay to continuous audio record and playback

Hello,

 

I'm working on a small project where we are using the Line-in of our desktop to record audio (For our test setup just a sine wave) we are then playing this back using the sound output write.vi.

 

What we want to be able to do is to add a controllable delay between the continuous record and playback. With the way that the example .vi we are using we are unclear on how to approach this. 

 

Do we need to have a form of FIFO buffer? or does labview support a vi that could achieve something like this?

 

If anyone could point us in the direction of any examples that function in a similar way or if you have build a .vi like this before any help would be greatly appreciated.

p.s We are using Labview 2010

0 Kudos
Message 1 of 2
(2,350 Views)

What you need to is indeed bufferize the acquired data for the time 'delay' that you want and then begin to read the queue.

You can do this with the Queues fonctions. You will have to calculate how many times you have to write into the FIFO before reading it to obtain your delay.

The read queue function should be in a parallel loop (your 'replay' loop). You can detect when to read using the Queue Status VI which will tell you how many samples are in the queue (which is related to your expected delay).

 

That can a start. More complex architecture can improve the precision on your delay, but try starting like this if you don't need a tight timing precision on your delay.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Message 2 of 2
(2,312 Views)