diff --git a/libraries/lib-audio-io/AudioIO.cpp b/libraries/lib-audio-io/AudioIO.cpp index 9e403353ac32..c237d9e4e996 100644 --- a/libraries/lib-audio-io/AudioIO.cpp +++ b/libraries/lib-audio-io/AudioIO.cpp @@ -2013,8 +2013,10 @@ bool AudioIO::ProcessPlaybackSlices( bool progress = false; size_t allProduced = 0; do { - const auto slice = - policy.GetPlaybackSlice(mPlaybackSchedule, available); + const bool paused = IsPaused(); + const auto slice = paused + ? PlaybackSlice{ available, available, 0 } // produce all zeroes + : policy.GetPlaybackSlice(mPlaybackSchedule, available); const auto &[frames, toProduce] = slice; progress = progress || toProduce > 0; @@ -2058,8 +2060,9 @@ bool AudioIO::ProcessPlaybackSlices( available -= frames; // wxASSERT(available >= 0); // don't assert on this thread - done = policy.RepositionPlayback( mPlaybackSchedule, mPlaybackMixers, - frames, available ); + done = !paused && + policy.RepositionPlayback( mPlaybackSchedule, mPlaybackMixers, + frames, available ); } while (available && !done); // Do any realtime effect processing, more efficiently in at most @@ -3120,11 +3123,6 @@ int AudioIoCallback::AudioCallback( framesPerBuffer, outputMeterFloats); - // Test for no sequence audio to play (because we are paused and have faded - // out) - if (paused && (!mbMicroFades || mOldMasterGain == 0.0f)) - return callbackReturn; - // To add sequence output to output (to play sound on speaker) // possible exit, if we were seeking.