Overview
TheTranscriptionResult class represents the output of a transcription operation. It contains the transcribed text, detailed segment information, language detection results, and performance timing data.
Class Definition
Initializer
String
Complete transcribed text
[TranscriptionSegment]
Array of transcription segments with timestamps and metadata
String
Detected or specified language code
TranscriptionTimings
Performance timing information
Float?
Seek time offset in seconds (for chunked audio)
Properties
String
The complete transcribed text. All segments are concatenated together.
[TranscriptionSegment]
Array of transcription segments, each containing:
- Text content
- Start and end timestamps
- Token information
- Quality metrics (log probabilities, compression ratio)
- Optional word-level timestamps
String
ISO 639-1 language code (e.g., “en” for English, “es” for Spanish) detected or specified for this transcription.
TranscriptionTimings
Detailed performance metrics including:
- Model loading time
- Audio processing time
- Encoding time
- Decoding time
- Total pipeline duration
- Real-time factor
Float?
Seek time offset in seconds when this result is part of a chunked transcription.
Computed Properties
[WordTiming]
Flat array of all word-level timings across all segments. Only populated when
wordTimestamps is enabled in DecodingOptions.Methods
logSegments()
Logs all segments with timestamps and text to the console.logTimings()
Logs detailed performance timing information to the console.- Audio loading time
- Audio processing time
- Mel spectrogram computation time
- Encoding time
- Decoding time breakdown
- Total pipeline duration
- Tokens per second
- Real-time factor
TranscriptionSegment
Each segment in thesegments array contains detailed information:
Properties
Int
Unique identifier for the segment
Int
Seek position in the audio (in samples)
Float
Start timestamp in seconds
Float
End timestamp in seconds
String
Transcribed text for this segment
[Int]
Token IDs generated for this segment
[[Int: Float]]
Log probabilities for each token
Float
Sampling temperature used for this segment
Float
Average log probability of all tokens (quality indicator)
Float
Text compression ratio (detects repetitive output)
Float
Probability that this segment contains no speech
[WordTiming]?
Optional array of word-level timings (only when
wordTimestamps is enabled)Float
Computed duration of the segment (end - start)
WordTiming
When word-level timestamps are enabled, each word includes:Properties
String
The word text
[Int]
Token IDs that comprise this word
Float
Start timestamp in seconds
Float
End timestamp in seconds
Float
Confidence probability for this word
Float
Computed duration (end - start)
TranscriptionTimings
Detailed performance metrics:Properties
TimeInterval
Total time spent loading models
TimeInterval
Time spent loading and converting audio
TimeInterval
Time spent processing audio samples
TimeInterval
Time spent computing mel spectrograms
TimeInterval
Time spent in audio encoder
TimeInterval
Time spent in text decoder predictions
TimeInterval
Total time spent in decoding loop
TimeInterval
Total end-to-end pipeline duration
Double
Computed: tokens generated per second
Double
Computed: ratio of processing time to audio duration (< 1.0 means faster than real-time)
Double
Computed: inverse of real-time factor (> 1.0 means faster than real-time)