Repository navigation
feat(speech): send long recordings to a provider in pieces that fit its limits - #362
Merged
Merged
Conversation
…ts limits
A recording longer or larger than a speech provider takes in one request is
cut at pauses into pieces within its limits, each piece is transcribed, and
the transcripts are joined on the recording's timeline. Each provider starts
with its published limits (speech.{provider}_max_minutes and _max_mb),
editable in Settings → Speech providers. Replaces the ten-minute parts only
OpenAI-compatible servers had.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9FY5GYBynyZQi49uouhUj
adeelahmad
pushed a commit
that referenced
this pull request
Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014pKRz6HkdQ7hTqEbpnyhYo
Merged
16 of 22 tasks
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.
Requested by Adeel · project thread
Description
Before: only OpenAI-compatible servers got long recordings in ten-minute parts. ElevenLabs, AssemblyAI and Deepgram were sent the whole recording in one request, so one over the provider's limit (10 hours for ElevenLabs and AssemblyAI; for Deepgram, anything that takes it over 10 minutes of work, which it answers with a 504) failed.
After: every speech provider gets a recording that is too long or too large for one request in pieces that fit it. Each piece ends at a pause, is transcribed on its own, and the transcripts are joined back into one on the recording's timeline. Each provider starts with its published limits, and Settings → Speech providers has Longest piece sent at once and Largest file sent at once for each one.
How:
speech.Engine.transcribenow owns the splitting for every provider.pieces()cuts at the quietest tenth of a second in the half minute before each duration limit (numpy energy over the samples already decoded).clips()encodes each piece and halves one whose file is still over the size limit, again at a pause. The provider functions now take one encoded clip. Segments, word timings and speaker labels are shifted onto the recording's timeline, and speaker labels get acN:prefix per piece, as the OpenAI parts had before. The activity ledger still writes one row per recording, now withpieceswhen there was more than one.Motivation and Context
Adeel asked for large audio files to be segmented automatically to each provider's limits.
Types of changes
!in the title)Checklist:
docs/accordingly (docs/speech-providers.md#long-recordings;mkdocs build --strictclean).## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
speech.{provider}_max_minutesand_max_mb), so the settings API and the assistant'schange_settingstool can change them. The splitting needs nothing from anyone.pieces. Budgets still gate the call.openapi-checkdiff empty).🤖 Generated with Claude Code
https://claude.ai/code/session_01L9FY5GYBynyZQi49uouhUj
Generated by Claude Code