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.
This commit is contained in:
@@ -136,7 +136,7 @@ class GladiaSTTService(STTService):
|
|||||||
maximum_duration_without_endpointing: Optional[int] = 10
|
maximum_duration_without_endpointing: Optional[int] = 10
|
||||||
audio_enhancer: Optional[bool] = None
|
audio_enhancer: Optional[bool] = None
|
||||||
words_accurate_timestamps: Optional[bool] = None
|
words_accurate_timestamps: Optional[bool] = None
|
||||||
|
speech_threshold: Optional[float] = .99
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
@@ -148,7 +148,6 @@ class GladiaSTTService(STTService):
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
super().__init__(sample_rate=sample_rate, **kwargs)
|
super().__init__(sample_rate=sample_rate, **kwargs)
|
||||||
|
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
self._url = url
|
self._url = url
|
||||||
self._settings = {
|
self._settings = {
|
||||||
@@ -166,6 +165,7 @@ class GladiaSTTService(STTService):
|
|||||||
"maximum_duration_without_endpointing": params.maximum_duration_without_endpointing,
|
"maximum_duration_without_endpointing": params.maximum_duration_without_endpointing,
|
||||||
"pre_processing": {
|
"pre_processing": {
|
||||||
"audio_enhancer": params.audio_enhancer,
|
"audio_enhancer": params.audio_enhancer,
|
||||||
|
"speech_threshold": params.speech_threshold,
|
||||||
},
|
},
|
||||||
"realtime_processing": {
|
"realtime_processing": {
|
||||||
"words_accurate_timestamps": params.words_accurate_timestamps,
|
"words_accurate_timestamps": params.words_accurate_timestamps,
|
||||||
|
|||||||
Reference in New Issue
Block a user