Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61d5d540db |
No files matched your search
@@ -101,6 +101,9 @@ LVA_PULSE_COOKIE="/run/user/${LVA_USER_ID}/pulse/cookie"
|
|||||||
### Delay before mic opens for continued conversation (optional):
|
### Delay before mic opens for continued conversation (optional):
|
||||||
# CONTINUE_CONVERSATION_DELAY="0.5"
|
# CONTINUE_CONVERSATION_DELAY="0.5"
|
||||||
|
|
||||||
|
### Unducking delay (optional)
|
||||||
|
# UNDUCK_DELAY="1.2"
|
||||||
|
|
||||||
### Sound files (optional):
|
### Sound files (optional):
|
||||||
# path for custom files in docker is for example "sounds/custom/your_soundfile.flac"
|
# path for custom files in docker is for example "sounds/custom/your_soundfile.flac"
|
||||||
# WAKEUP_SOUND="sounds/wake_word_triggered.flac"
|
# WAKEUP_SOUND="sounds/wake_word_triggered.flac"
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ if [ -n "${CONTINUE_CONVERSATION_DELAY}" ]; then
|
|||||||
EXTRA_ARGS+=( "--continue-conversation-delay" "$CONTINUE_CONVERSATION_DELAY" )
|
EXTRA_ARGS+=( "--continue-conversation-delay" "$CONTINUE_CONVERSATION_DELAY" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${UNDUCK_DELAY}" ]; then
|
||||||
|
EXTRA_ARGS+=( "--unduck-delay" "$UNDUCK_DELAY" )
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${WAKEUP_SOUND}" ]; then
|
if [ -n "${WAKEUP_SOUND}" ]; then
|
||||||
EXTRA_ARGS+=( "--wakeup-sound" "$WAKEUP_SOUND" )
|
EXTRA_ARGS+=( "--wakeup-sound" "$WAKEUP_SOUND" )
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -118,6 +118,12 @@ async def main() -> None:
|
|||||||
default=0.5,
|
default=0.5,
|
||||||
help="Seconds to wait after TTS finishes before opening the mic for continued conversation (default: 0.5)",
|
help="Seconds to wait after TTS finishes before opening the mic for continued conversation (default: 0.5)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--unduck-delay",
|
||||||
|
type=float,
|
||||||
|
default=0.0,
|
||||||
|
help="Seconds to keep music ducked after TTS finishes (default: 0.0)",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--wakeup-sound",
|
"--wakeup-sound",
|
||||||
default=str(_SOUNDS_DIR / "wake_word_triggered.flac"),
|
default=str(_SOUNDS_DIR / "wake_word_triggered.flac"),
|
||||||
@@ -438,6 +444,7 @@ async def main() -> None:
|
|||||||
preferences_path=preferences_path,
|
preferences_path=preferences_path,
|
||||||
refractory_seconds=args.refractory_seconds,
|
refractory_seconds=args.refractory_seconds,
|
||||||
continue_conversation_delay=args.continue_conversation_delay,
|
continue_conversation_delay=args.continue_conversation_delay,
|
||||||
|
unduck_delay=args.unduck_delay,
|
||||||
output_only=args.output_only,
|
output_only=args.output_only,
|
||||||
download_dir=args.download_dir,
|
download_dir=args.download_dir,
|
||||||
volume=initial_volume,
|
volume=initial_volume,
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ class ServerState:
|
|||||||
preferences_path: Path
|
preferences_path: Path
|
||||||
download_dir: Path
|
download_dir: Path
|
||||||
continue_conversation_delay: float = 0.5 # seconds to wait after TTS before opening mic
|
continue_conversation_delay: float = 0.5 # seconds to wait after TTS before opening mic
|
||||||
|
unduck_delay: float = 0.0 # seconds to keep music ducked after TTS ends
|
||||||
|
|
||||||
media_player_entity: "Optional[MediaPlayerEntity]" = None
|
media_player_entity: "Optional[MediaPlayerEntity]" = None
|
||||||
satellite: "Optional[VoiceSatelliteProtocol]" = None
|
satellite: "Optional[VoiceSatelliteProtocol]" = None
|
||||||
|
|||||||
@@ -957,7 +957,12 @@ class VoiceSatelliteProtocol(APIServer):
|
|||||||
threading.Timer(self.state.continue_conversation_delay, _start_continued_conversation).start()
|
threading.Timer(self.state.continue_conversation_delay, _start_continued_conversation).start()
|
||||||
else:
|
else:
|
||||||
self._continue_conversation = False
|
self._continue_conversation = False
|
||||||
self.unduck()
|
unduck_delay = self.state.unduck_delay
|
||||||
|
if unduck_delay > 0:
|
||||||
|
_LOGGER.debug("Unducking after %.2fs", unduck_delay)
|
||||||
|
threading.Timer(unduck_delay, self.unduck).start()
|
||||||
|
else:
|
||||||
|
self.unduck()
|
||||||
self._emit(LVAEvent.IDLE)
|
self._emit(LVAEvent.IDLE)
|
||||||
|
|
||||||
_LOGGER.debug("TTS response finished")
|
_LOGGER.debug("TTS response finished")
|
||||||
|
|||||||
Reference in new issue
Block a user