Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy audio buffer and send for playback without blocking, fixes Windows audio choppyness #18

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

zment4
Copy link
Contributor

@zment4 zment4 commented Aug 16, 2022

Closes espeak-ng/espeak-ng#1190

Fixes audio choppyness in Windows.

Added callback for OnBufferEnd to free the manually malloced audio buffer memory.

Blocks on write only if SubmitSourceBuffer() fails, as that means the XAudio2 SourceVoice interface is full and can't accept anymore buffers - so we'll just block until it succeeds.

Otherwise write is now non-blocking, so no gaps in audio playback anymore. Also, drain now waits for the all of the remaining buffers to be played back.

@alex19EP
Copy link
Member

I think you can add closes keyword to espeak-ng/espeak-ng#1190 in pr description

otherwise looks good. thank you for contribution!

@alex19EP
Copy link
Member

@jaacoppi @valdisvi it seems I have no maintainer power in this repo...

@valdisvi
Copy link
Member

@alex19EP check now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Espeak-ng stutters when reading live on Windows
3 participants