The full audio to transcribe
The provider's hard upload ceiling
Target piece size, below the ceiling to leave room for multipart framing
Splitter to use for oversized audio; may be null, in which case oversized audio fails
Provider name, used in the size-limit error messages
Transcribes a single piece already known to be within the ceiling
OptionalcancellationToken: AbortSignalCancels the transcription between pieces, and is passed to each piece
Transcribes audio that may exceed a provider's upload ceiling, splitting it first when it does, and joins the pieces back into one transcript and one duration.
Pieces are transcribed sequentially, not in parallel: transcription providers rate limit by audio-seconds per minute, so firing an hour of audio at once buys nothing but 429s, and a partial failure mid-way would leave a transcript with an unmarked hole in it.
The returned
durationSecondsis the sum across pieces, which is what the provider bills, and is left undefined if ANY piece failed to report one, since a partial sum would understate the bill while looking like a complete answer.A free function rather than a protected method so that
BaseAudioGenerator(which keeps it as one, for its drivers) can still be assigned to BaseSpeechToText.Once
cancellationTokenaborts, no further piece is sent: the next piece throws a cancellation error (classifiedCancelled) instead. The token is also handed totranscribeOne, which forwards it to its request so the piece in flight is torn down too.