Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter Class Reference

Public Member Functions

None __post_init__ (self)
 
bool process (self, float chunk_seconds, float|None speech_probability)
 
bool process_with_vad (self, bytes chunk, int|None vad_samples_per_chunk, Callable[[bytes], bool] vad_is_speech, AudioBuffer|None leftover_chunk_buffer)
 
None reset (self)
 

Public Attributes

 in_command
 
 timed_out
 

Static Public Attributes

 bool
 
 float
 

Private Attributes

 _command_seconds_left
 
 _reset_seconds_left
 
 _silence_seconds_left
 
 _speech_seconds_left
 
 _timeout_seconds_left
 

Detailed Description

Segments an audio stream into voice commands.

Definition at line 75 of file vad.py.

Member Function Documentation

◆ __post_init__()

None homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.__post_init__ (   self)
Reset after initialization.

Definition at line 120 of file vad.py.

◆ process()

bool homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.process (   self,
float  chunk_seconds,
float | None  speech_probability 
)
Process samples using external VAD.

Returns False when command is done.

Definition at line 133 of file vad.py.

◆ process_with_vad()

bool homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.process_with_vad (   self,
bytes  chunk,
int | None  vad_samples_per_chunk,
Callable[[bytes], bool vad_is_speech,
AudioBuffer | None  leftover_chunk_buffer 
)
Process an audio chunk using an external VAD.

A buffer is required if the VAD requires fixed-sized audio chunks (usually the case).

Returns False when voice command is finished.

Definition at line 200 of file vad.py.

◆ reset()

None homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.reset (   self)
Reset all counters and state.

Definition at line 124 of file vad.py.

Member Data Documentation

◆ _command_seconds_left

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter._command_seconds_left
private

Definition at line 127 of file vad.py.

◆ _reset_seconds_left

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter._reset_seconds_left
private

Definition at line 130 of file vad.py.

◆ _silence_seconds_left

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter._silence_seconds_left
private

Definition at line 128 of file vad.py.

◆ _speech_seconds_left

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter._speech_seconds_left
private

Definition at line 126 of file vad.py.

◆ _timeout_seconds_left

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter._timeout_seconds_left
private

Definition at line 129 of file vad.py.

◆ bool

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.bool
static

Definition at line 93 of file vad.py.

◆ float

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.float
static

Definition at line 78 of file vad.py.

◆ in_command

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.in_command

Definition at line 131 of file vad.py.

◆ timed_out

homeassistant.components.assist_pipeline.vad.VoiceCommandSegmenter.timed_out

Definition at line 139 of file vad.py.


The documentation for this class was generated from the following file: