fix/float error

This commit is contained in:
rahulpscraftech360 2025-08-30 14:05:11 +05:30
parent 1bbc044488
commit 043e05e47c

View file

@ -75,9 +75,9 @@ class ASRProviderBase(ABC):
f"audio_len={len(audio)}, asr_buffer_len={len(conn.asr_audio)}") f"audio_len={len(audio)}, asr_buffer_len={len(conn.asr_audio)}")
# Echo suppression: Ignore audio for a brief period after starting to listen # Echo suppression: Ignore audio for a brief period after starting to listen
if hasattr(conn, 'listen_start_time'): if hasattr(conn, 'listen_start_time') and conn.listen_start_time is not None:
time_since_listen_start = time.time() - conn.listen_start_time time_since_listen_start = time.time() - conn.listen_start_time
if time_since_listen_start < 0.1: # Ignore first 300ms of audio (echo period) if time_since_listen_start < 0.1: # Ignore first 100ms of audio (echo period)
if have_voice: if have_voice:
logger.bind(tag=TAG).debug(f"Ignoring potential echo audio ({time_since_listen_start:.2f}s after listen start)") logger.bind(tag=TAG).debug(f"Ignoring potential echo audio ({time_since_listen_start:.2f}s after listen start)")
have_voice = False have_voice = False