Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ LVA_PULSE_COOKIE="/run/user/${LVA_USER_ID}/pulse/cookie"
# PROCESSING_SOUND="sounds/processing.wav"
# MUTE_SOUND="sounds/mute_switch_on.flac"
# UNMUTE_SOUND="sounds/mute_switch_off.flac"
# PIPELINE_ENDED_SOUND="sounds/pipeline_ended.wav"
Comment thread
omaramin-2000 marked this conversation as resolved.
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ if [ -n "${UNMUTE_SOUND}" ]; then
EXTRA_ARGS+=( "--unmute-sound" "$UNMUTE_SOUND" )
fi

if [ -n "${PIPELINE_ENDED_SOUND}" ]; then
EXTRA_ARGS+=( "--pipeline-ended-sound" "$PIPELINE_ENDED_SOUND" )
fi


# Add cookie file for pulseaudio to prevent errors
PULSE_COOKIE=${PULSE_COOKIE:-"/run/user/1000/pulse/cookie"}
Expand Down
6 changes: 6 additions & 0 deletions linux_voice_assistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ async def main() -> None:
default=str(_SOUNDS_DIR / "mute_switch_off.flac"),
help="Sound to play when unmuting the assistant",
)
parser.add_argument(
"--pipeline-ended-sound",
default="",
help="Sound to play when the voice pipeline ends without a response (e.g. no speech detected). Disabled by default.",
Comment thread
florian-asche marked this conversation as resolved.
Outdated
)
parser.add_argument(
"--preferences-file",
default=_REPO_DIR / "preferences.json",
Expand Down Expand Up @@ -348,6 +353,7 @@ async def main() -> None:
processing_sound=args.processing_sound,
mute_sound=args.mute_sound,
unmute_sound=args.unmute_sound,
pipeline_ended_sound=args.pipeline_ended_sound,
preferences=preferences,
preferences_path=preferences_path,
refractory_seconds=args.refractory_seconds,
Expand Down
1 change: 1 addition & 0 deletions linux_voice_assistant/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class ServerState:
timer_finished_sound: str
mute_sound: str
unmute_sound: str
pipeline_ended_sound: str
preferences: Preferences
preferences_path: Path
download_dir: Path
Expand Down
9 changes: 8 additions & 1 deletion linux_voice_assistant/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,14 @@ def _tts_finished(self) -> None:
self._pipeline_active = True
_LOGGER.debug("Continuing conversation")
else:
self.unduck()
if self.state.pipeline_ended_sound and not self._tts_played:
_LOGGER.debug("Playing pipeline ended sound")
self.state.tts_player.play(
self.state.pipeline_ended_sound,
done_callback=self.unduck,
)
else:
self.unduck()

_LOGGER.debug("TTS response finished")

Expand Down
Binary file added sounds/pipeline_ended.wav
Binary file not shown.
Loading