Create audio loopback with custom latency

Subscribe to RSS news feed

DAF sample

Sometimes it may be needed to control the audio chunks manually to achieve some special functionality. For example, in DAF sample we pass audio chunks from recording to playback device. Although it may be done by simply linking waveIn to waveOut component, we need to ensure very short delay, of about 20 ms. Due to buffering, it only possible if we take control of the process and pass audio chunks to playback device as soon as they arrive from recording device.

Main job is done by the unaAudioFeedbackClass class declared in unaAudioFeedback.pas unit. It intercept audio chunks by assigning onDataAvailable event handler for waveIn component. Then chunk is being delayed by specified number of milliseconds (or no delayed at all) and sent to internal waveOut component.

Download

Precompiled binary of this sample is included in the Demos package.