Compare commits

...

1 Commits

Author SHA1 Message Date
Mark Backman
a76f1f331c Add sample rate support for 22050, 44100, 48000 Hz for GradiumSTTService 2026-03-18 16:24:31 -04:00
2 changed files with 7 additions and 1 deletions

View File

@@ -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.

View File

@@ -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"
)