Audio playback delay


#1

Hello everyone, I’m developing a simple audio recording/playback application using the Juce AudioRecordingDemo as a starting point. 99% of the time it works great and starts playback instantly but sometimes there is a slight ~1sec delay before it starts playing. I tried changing the device type to DirectSound or ASIO but the result is still the same. I also tried using MixerAudioSource to no avail. I sent the software to a friend and he is experiencing the same issue so that tells me its a bug in my code, not with Juce itself.

Is there any way to detect when this delay occurs? I tried playing a test sound and using AudioTransportSource.getCurrentPosition/hasStreamFinished to detect when the audio starts/stops playing but the values never change when the delay occurs, the position still increments as if there was no delay. Has anyone else experienced this issue before?


Audio Playback Delay Bug?
#2

I’m completely stumped as to what is causing this issue. I can provide source code but its a bit lengthy and almost identical to the AudioRecordingDemo/AudioPlaybackDemo, besides the fact that its using MixerAudioSource. Any help would be greatly appreciated. Tom