mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Log timeouts for assist_pipeline
end of speech detection (#122182)
* log timeouts * import logger the right way
This commit is contained in:
parent
e6e748ae0a
commit
7e0970e917
@ -6,8 +6,11 @@ from abc import ABC, abstractmethod
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import dataclass
|
||||
from enum import StrEnum
|
||||
import logging
|
||||
from typing import Final, cast
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
_SAMPLE_RATE: Final = 16000 # Hz
|
||||
_SAMPLE_WIDTH: Final = 2 # bytes
|
||||
|
||||
@ -159,6 +162,10 @@ class VoiceCommandSegmenter:
|
||||
"""
|
||||
self._timeout_seconds_left -= chunk_seconds
|
||||
if self._timeout_seconds_left <= 0:
|
||||
_LOGGER.warning(
|
||||
"VAD end of speech detection timed out after %s seconds",
|
||||
self.timeout_seconds,
|
||||
)
|
||||
self.reset()
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user