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

Added support to skip TTS playback #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions wyoming_satellite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ async def main() -> None:
# Sound output
parser.add_argument("--snd-uri", help="URI of Wyoming sound service")
parser.add_argument("--snd-command", help="Program to run for sound output")
parser.add_argument("--snd-tts-skip-playback", help="Skip TTS playback. Defaults False")
parser.add_argument(
"--snd-command-rate",
type=int,
Expand Down Expand Up @@ -396,6 +397,7 @@ async def main() -> None:
volume_multiplier=args.snd_volume_multiplier,
awake_wav=args.awake_wav,
done_wav=args.done_wav,
tts_skip_playback=args.snd_tts_skip_playback
),
event=EventSettings(
uri=args.event_uri,
Expand Down
3 changes: 2 additions & 1 deletion wyoming_satellite/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ async def event_from_server(self, event: Event) -> None:
forward_event = False
elif AudioChunk.is_type(event.type):
# TTS audio
await self.event_to_snd(event)
if not self.settings.snd.tts_skip_playback:
await self.event_to_snd(event)
forward_event = False
elif AudioStart.is_type(event.type):
# TTS started
Expand Down
3 changes: 3 additions & 0 deletions wyoming_satellite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class SndSettings(ServiceSettings):
done_wav: Optional[str] = None
"""Path to WAV file played after voice command is recognized."""

tts_skip_playback: Optional[bool] = False
"""Skip TTS playback. Defaults to False."""

rate: int = 22050
"""Sample rate of output audio (hertz)"""

Expand Down