Changing the default behavior to only use the last vad segment, and increasing the default stop_secs to 3
This commit is contained in:
@@ -21,17 +21,18 @@ class EndOfTurnState(Enum):
|
|||||||
|
|
||||||
|
|
||||||
# Default timing parameters
|
# Default timing parameters
|
||||||
STOP_SECS = 1
|
STOP_SECS = 3
|
||||||
PRE_SPEECH_MS = 0
|
PRE_SPEECH_MS = 0
|
||||||
MAX_DURATION_SECONDS = 8 # Max allowed segment duration
|
MAX_DURATION_SECONDS = 8 # Max allowed segment duration
|
||||||
USE_ONLY_LAST_VAD_SEGMENT = False
|
USE_ONLY_LAST_VAD_SEGMENT = True
|
||||||
|
|
||||||
|
|
||||||
class SmartTurnParams(BaseModel):
|
class SmartTurnParams(BaseModel):
|
||||||
stop_secs: float = STOP_SECS
|
stop_secs: float = STOP_SECS
|
||||||
pre_speech_ms: float = PRE_SPEECH_MS
|
pre_speech_ms: float = PRE_SPEECH_MS
|
||||||
max_duration_secs: float = MAX_DURATION_SECONDS
|
max_duration_secs: float = MAX_DURATION_SECONDS
|
||||||
use_only_last_vad_segment: bool = USE_ONLY_LAST_VAD_SEGMENT
|
# not exposing this for now yet until the model can handle it.
|
||||||
|
# use_only_last_vad_segment: bool = USE_ONLY_LAST_VAD_SEGMENT
|
||||||
|
|
||||||
|
|
||||||
class BaseSmartTurn(ABC):
|
class BaseSmartTurn(ABC):
|
||||||
@@ -99,7 +100,7 @@ class BaseSmartTurn(ABC):
|
|||||||
def analyze_end_of_turn(self) -> EndOfTurnState:
|
def analyze_end_of_turn(self) -> EndOfTurnState:
|
||||||
logger.debug("Analyzing End of Turn...")
|
logger.debug("Analyzing End of Turn...")
|
||||||
state = self._process_speech_segment(self._audio_buffer)
|
state = self._process_speech_segment(self._audio_buffer)
|
||||||
if state == EndOfTurnState.COMPLETE or self._params.use_only_last_vad_segment:
|
if state == EndOfTurnState.COMPLETE or USE_ONLY_LAST_VAD_SEGMENT:
|
||||||
self._clear()
|
self._clear()
|
||||||
logger.debug(f"End of Turn result: {state}")
|
logger.debug(f"End of Turn result: {state}")
|
||||||
return state
|
return state
|
||||||
|
|||||||
Reference in New Issue
Block a user