Skip to content

Commit

Permalink
Revert "fix: adding timeout to WakeStreamingSatellite event_from_mic …
Browse files Browse the repository at this point in the history
…to keep it from getting stuck"

This reverts commit 62c7280.
  • Loading branch information
sayam93 committed Dec 26, 2024
1 parent 62c7280 commit ae8f34e
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions wyoming_satellite/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,6 @@ def __init__(self, settings: SatelliteSettings) -> None:
# wake word id -> seconds
self.refractory_timestamp: Dict[Optional[str], float] = {}

# Timestamp in the future when we will have timed out (set with
# time.monotonic())
self.timeout_seconds: Optional[float] = None

if settings.vad.enabled:
_LOGGER.warning("VAD is enabled but will not be used")

Expand Down Expand Up @@ -1300,25 +1296,6 @@ async def event_from_mic(
if self.stt_audio_writer is not None:
self.stt_audio_writer.write(audio_bytes)

if ( self.is_streaming
and (self.timeout_seconds is not None)
and (time.monotonic() >= self.timeout_seconds)
):
_LOGGER.debug("Streaming timed out, stopping")
# Time out during wake word recognition
self.is_streaming = False
self.timeout_seconds = None

# Stop debug recording
if self.stt_audio_writer is not None:
self.stt_audio_writer.stop()

# Stop pipeline
await self.event_to_server(AudioStop().event())

_LOGGER.info("Waiting for speech")
await self.trigger_streaming_stop()

if self.is_streaming:
# Forward to server
await self.event_to_server(event)
Expand Down Expand Up @@ -1370,17 +1347,6 @@ async def event_from_wake(self, event: Event) -> None:
# No refractory period
self.refractory_timestamp.pop(detection.name, None)

# set our timeout window
if self.settings.vad.wake_word_timeout is not None:
# Set future time when we'll stop streaming if the wake word
# hasn't been detected.
self.timeout_seconds = (
time.monotonic() + self.settings.vad.wake_word_timeout
)
else:
# No timeout
self.timeout_seconds = None

# Forward to the server
await self.event_to_server(event)

Expand Down

0 comments on commit ae8f34e

Please sign in to comment.