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

fix/playback thread #29

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ovos_audio/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PlaybackThread(Thread):
"""

def __init__(self, queue=TTS.queue, bus=None):
super(PlaybackThread, self).__init__()
super(PlaybackThread, self).__init__(daemon=True)
self.queue = queue or TTS.queue
self._terminated = False
self._processing_queue = False
Expand Down Expand Up @@ -156,7 +156,7 @@ def _play(self):
self.activate_tts(tts_id)
self.on_start(message)

data = self.tts_transform.transform(data, message.context)
data, message.context = self.tts_transform.transform(data, message.context)

self.p = play_audio(data)
if visemes:
Expand Down Expand Up @@ -191,6 +191,7 @@ def run(self, cb=None):
If the queue is empty the tts.end_audio() is called possibly triggering
listening.
"""
LOG.info("PlaybackThread started")
self._paused = False
self._started.set()
while not self._terminated:
Expand Down
1 change: 1 addition & 0 deletions ovos_audio/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,
if TTS.queue is None:
TTS.queue = Queue()
self.playback_thread = PlaybackThread(TTS.queue, self.bus)
self.playback_thread.start()

try:
self._maybe_reload_tts()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ovos-utils~=0.0, >=0.0.34
ovos-bus-client~=0.0, >=0.0.5a1
ovos-config~=0.0,>=0.0.10
ovos-plugin-manager~=0.0, >=0.0.24a11
ovos-plugin-manager~=0.0, >=0.0.24a12

ovos_plugin_common_play~=0.0, >=0.0.6a2

Expand Down