nvda
a1a2bc00 - Fix index skipping when trimming leading silence (#17707)

Commit
354 days ago
Fix index skipping when trimming leading silence (#17707) Fixes #17706. Summary of the issue: If an audio chunk is purely silence, then the entire chunk will be removed when "Trim leading silence in speech audio" is enabled. However, in WasapiPlayer::feed, if there's no audio to be played (the size is zero), the entire block of while (remainingFrames > 0) will be skipped. As a result, the device won't be opened if it was not opened before, and if the device isn't opened, the callback functions will not be triggered. When passing only a CallbackCommand with no speech to the synth, it will usually generate a short silence with the correct index reached event. But after the silence is trimmed entirely, the callback functions may not be triggered correctly, and the corresponding CallbackCommand may be dropped. Description of user facing changes The problem mentioned above will be fixed. Description of development approach If the audio chunk has a non-zero size, but its size becomes zero after trimming the silence, then add a silent frame, so that the crucial code part that calls the callback functions will not be skipped.
Author
Parents
Loading