From 5f1848d24b76f9b5afeed480e1aa43f838681979 Mon Sep 17 00:00:00 2001 From: allenmylath Date: Mon, 3 Mar 2025 23:21:11 +0530 Subject: [PATCH] Update gladia.py (#1317) * Update gladia.py According to gladia docs https://docs.gladia.io/api-reference/v2/live/init speech threshould value close to 1 enables gladia to better isolate speeech from noise. --- src/pipecat/services/gladia.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipecat/services/gladia.py b/src/pipecat/services/gladia.py index f0a00b327..5082e9ea2 100644 --- a/src/pipecat/services/gladia.py +++ b/src/pipecat/services/gladia.py @@ -136,7 +136,7 @@ class GladiaSTTService(STTService): maximum_duration_without_endpointing: Optional[int] = 10 audio_enhancer: Optional[bool] = None words_accurate_timestamps: Optional[bool] = None - + speech_threshold: Optional[float] = .99 def __init__( self, *, @@ -144,11 +144,10 @@ class GladiaSTTService(STTService): url: str = "https://api.gladia.io/v2/live", confidence: float = 0.5, sample_rate: Optional[int] = None, - params: InputParams = InputParams(), + params: InputParams = InputParams(), **kwargs, ): super().__init__(sample_rate=sample_rate, **kwargs) - self._api_key = api_key self._url = url self._settings = { @@ -166,6 +165,7 @@ class GladiaSTTService(STTService): "maximum_duration_without_endpointing": params.maximum_duration_without_endpointing, "pre_processing": { "audio_enhancer": params.audio_enhancer, + "speech_threshold": params.speech_threshold, }, "realtime_processing": { "words_accurate_timestamps": params.words_accurate_timestamps,