fix: reduce debug log message amount when no audio received
Used to be every `timeout` time that we'd get the message that no audio data is received. Now only the first time since no data is received. ref: N25B-213
This commit is contained in:
@@ -58,8 +58,10 @@ class Streaming(CyclicBehaviour):
|
|||||||
async def run(self) -> None:
|
async def run(self) -> None:
|
||||||
data = await self.audio_in_poller.poll()
|
data = await self.audio_in_poller.poll()
|
||||||
if data is None:
|
if data is None:
|
||||||
|
if len(self.audio_buffer) > 0:
|
||||||
logger.debug("No audio data received. Discarding buffer until new data arrives.")
|
logger.debug("No audio data received. Discarding buffer until new data arrives.")
|
||||||
self.audio_buffer = np.array([], dtype=np.float32)
|
self.audio_buffer = np.array([], dtype=np.float32)
|
||||||
|
self.i_since_speech = 100
|
||||||
return
|
return
|
||||||
|
|
||||||
# copy otherwise Torch will be sad that it's immutable
|
# copy otherwise Torch will be sad that it's immutable
|
||||||
|
|||||||
Reference in New Issue
Block a user