Is there any way to handle errors of the audio callback failure?
“Failure” means callbacks runs out of the time. For example, let’s think in case sampling rate is 48000 and number of sample block is 1024. My callback “fails” in case it takes more than 21.333…ms( 1024.0 / 48000.0 * 1000.0)
I want something like this listener…
//at juce_AudioDeviceManager.cpp
void AudioDeviceManager::audioDeviceIOCallbackInt (const float**...)
{
auto time = juce::Time::getCurrentTime()
//JUCE codes...
time = juce::Time::getCurrentTime() - time;
//"limit" == numSampleBlock / samplingRate.
if(time > limit)
{
failureListeners.call([](FailureListener& l) { l.IOFailed(); });
}
}
//=========================
//My code
class MyClass : private FailureListener
{
void IOFailed()override
{
//Notify .
}
}