fix(speechmatics): resample audio to the 16 kHz Agent STT accepts - #5719
Open
omChauhanDev wants to merge 1 commit into
Open
fix(speechmatics): resample audio to the 16 kHz Agent STT accepts#5719omChauhanDev wants to merge 1 commit into
omChauhanDev wants to merge 1 commit into
Conversation
omChauhanDev
force-pushed
the
fix/speechmatics-agent-stt-sample-rate
branch
from
September 12, 2026 13:21
dbeb0fe to
4760430
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5717
Problem
Since 1.10.0
SpeechmaticsSTTServicetargets Agent STT (/v2/agent), which accepts 16 kHz only. The service still declared the pipeline's input rate inaudio_format, so any pipeline not running at 16 kHz opens a session the server rejects withaudio_format.sample_rate does not match: 16000. That includes the 8 kHz telephony setuppipecat initgenerates. The rejection is permanent, so the service is left unusable, and a Speechmatics instance sitting behind aServiceSwitcheras a backup dies at pipeline start before it is ever selected.Passing
sample_rate=16000to the service did not help: it changed the declared rate without converting the audio, so 8 kHz PCM went out labelled as 16 kHz.Changes
run_sttnow resamples audio to 16 kHz before sending it, andaudio_formatdeclares that fixed rate instead of the pipeline's, so the declared rate and the bytes cannot disagree. The conversion reads the rate recorded insetup(), which means asample_rateoverride cannot declare a rate the audio does not have. Pipelines already running at 16 kHz are unaffected.