Sleep emulator thread if too many samples queued

This commit is contained in:
wheremyfoodat 2024-02-24 00:29:48 +02:00
parent 56f716c1f1
commit 8148e68c4c

View file

@ -131,6 +131,7 @@ void TeakraDSP::setAudioEnabled(bool enable) {
// Wait until we've actually got room to do so
while (sampleBuffer.size() + 2 > sampleBuffer.Capacity()) {
std::this_thread::sleep_for(std::chrono::milliseconds{1});
}
sampleBuffer.push(audioFrame.data(), audioFrame.size());