Log timeouts for assist_pipeline end of speech detection (#122182)

* log timeouts

* import logger the right way
This commit is contained in:
HarvsG 2024-07-19 19:43:38 +01:00 committed by GitHub
parent e6e748ae0a
commit 7e0970e917
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,8 +6,11 @@ from abc import ABC, abstractmethod
from collections.abc import Iterable from collections.abc import Iterable
from dataclasses import dataclass from dataclasses import dataclass
from enum import StrEnum from enum import StrEnum
import logging
from typing import Final, cast from typing import Final, cast
_LOGGER = logging.getLogger(__name__)
_SAMPLE_RATE: Final = 16000 # Hz _SAMPLE_RATE: Final = 16000 # Hz
_SAMPLE_WIDTH: Final = 2 # bytes _SAMPLE_WIDTH: Final = 2 # bytes
@ -159,6 +162,10 @@ class VoiceCommandSegmenter:
""" """
self._timeout_seconds_left -= chunk_seconds self._timeout_seconds_left -= chunk_seconds
if self._timeout_seconds_left <= 0: if self._timeout_seconds_left <= 0:
_LOGGER.warning(
"VAD end of speech detection timed out after %s seconds",
self.timeout_seconds,
)
self.reset() self.reset()
return False return False