mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix piper beckend audio getting discarded on windows
This commit is contained in:
parent
1aa97dbcf6
commit
8166621971
@ -308,6 +308,9 @@ class Piper(TTSBackend):
|
||||
self._audio_sink = QAudioSink(fmt, self)
|
||||
if s.volume is not None:
|
||||
self._audio_sink.setVolume(s.volume)
|
||||
# On Windows, the buffer is zero causing data to be discarded.
|
||||
# Ensure we have a nice large buffer on all platforms.
|
||||
self._audio_sink.setBufferSize(2 * 1024 * 1024)
|
||||
self._audio_sink.stateChanged.connect(self._utterances_being_spoken.audio_state_changed)
|
||||
self._process.start()
|
||||
self._audio_sink.start(self._utterances_being_spoken)
|
||||
|
Loading…
x
Reference in New Issue
Block a user