Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Turns out that eSpeak-NG (the main user of this lib) enforces a minimum
buffer size of 60ms which is also the default size. This explains why
smaller LATENCY values were inducing choppiness in the audio on some
systems. Adjust the comment accordingly,.
Also make sure computed buffer sizes don't land in the middle of a
sample frame. Doing (samplerate * channels * LATENCY) / 1000 is wrong.
Both ALSA and PulseAudio provide nice abstractions for buffer sizing
so let's use them directly. In the ALSA case in particular, we want the
period to be 60ms, not the whole buffer, so to interleave speech audio
computation and audio playback.