Skip to content

Commit

Permalink
stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jan 29, 2025
1 parent 94fcc6b commit ec7dd1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ovos_plugin_manager/templates/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,13 +1121,15 @@ def __init__(self, bus, play_args=None, tts_config=None):
self.bus = bus
self.config = tts_config or {}
if not play_args:
# Check for the available player depending on the system's audio server.
player = shutil.which("pw-play") or shutil.which("paplay") or shutil.which("ffplay")
# Check for the best available player depending on the system's audio server.
# anything that accepts audio via stdin should work
player = shutil.which("ffplay") or shutil.which("pw-play") or shutil.which("paplay") or shutil.which("aplay")
if not player:
raise RuntimeError("No audio player found (please install 'ffmpeg' or 'pulseaudio-utils').")
raise RuntimeError("No audio player found (please install 'ffmpeg', 'pulseaudio-utils' or 'alsa-utils').")
self.play_args = [player]
if player.endswith("ffplay"):
self.play_args += ["-autoexit", "-nodisp", "-"]
self.play_args += ["-autoexit", "-nodisp"]
self.play_args += ["-"]
else:
self.play_args = play_args
self._process = None
Expand Down

0 comments on commit ec7dd1e

Please sign in to comment.