type TranscribeFileOptions = { // Language & Translation language?: string // Default: 'auto' (auto-detect) translate?: boolean // Translate to English (default: false) // Performance maxThreads?: number // Default: 2 for 4-core, 4 for 8+ cores nProcessors?: number // Parallel processing (default: 1) // Context & Prompting maxContext?: number // Max context tokens prompt?: string // Initial prompt to guide transcription // Timestamps & Segmentation tokenTimestamps?: boolean // Enable token-level timestamps wordThold?: number // Word timestamp probability threshold offset?: number // Time offset in ms duration?: number // Process duration in ms // Quality Settings temperature?: number // Decoding temperature (default: 0.0) temperatureInc?: number // Temperature increment on failure beamSize?: number // Beam search size bestOf?: number // Number of best candidates // Advanced maxLen?: number // Max segment length in characters tdrzEnable?: boolean // Enable tinydiarize (requires tdrz model) // Callbacks onProgress?: (progress: number) => void onNewSegments?: (result: TranscribeNewSegmentsResult) => void}
type TranscribeResult = { result: string // Full transcription text language: string // Detected/specified language code segments: Array<{ text: string // Segment text t0: number // Start time in ms t1: number // End time in ms }> isAborted: boolean // True if stopped via stop()}
Example result:
{ result: "And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.", language: "en", segments: [ { text: "And so my fellow Americans,", t0: 0, t1: 2000 }, { text: "ask not what your country can do for you,", t0: 2000, t1: 5000 }, { text: "ask what you can do for your country.", t0: 5000, t1: 8000 } ], isAborted: false}