Add sample rate support for 22050, 44100, 48000 Hz for GradiumSTTService
This commit is contained in:
@@ -1 +1 @@
|
||||
- `GradiumSTTService` now takes both an `encoding` and `sample_rate` constructor argument which is assmebled in the class to form the `input_format`. PCM accepts `8000`, `16000`, and `24000` Hz sample rates.
|
||||
- `GradiumSTTService` now takes both an `encoding` and `sample_rate` constructor argument which is assmebled in the class to form the `input_format`. PCM accepts `8000`, `16000`, `22050`, `24000`, `44100`, and `48000` Hz sample rates.
|
||||
|
||||
@@ -69,8 +69,14 @@ def _input_format_from_encoding(encoding: str, sample_rate: int) -> str:
|
||||
return "pcm_8000"
|
||||
case 16000:
|
||||
return "pcm_16000"
|
||||
case 22050:
|
||||
return "pcm_22050"
|
||||
case 24000:
|
||||
return "pcm_24000"
|
||||
case 44100:
|
||||
return "pcm_44100"
|
||||
case 48000:
|
||||
return "pcm_48000"
|
||||
logger.warning(
|
||||
f"GradiumSTTService: unsupported sample rate {sample_rate} for PCM encoding, using pcm_16000"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user