import { type AudioBufferLike } from '../asr/pcm-wav.js'; /** The payload shape returned by MediaRecorderSession. */ export interface RecordedAudioPayload { readonly base64: string; readonly mimeType: string; } export type MediaCaptureBackend = 'local-whisper' | 'cloud-openai'; interface LocalWhisperAudioContext { decodeAudioData(audioData: ArrayBuffer): Promise; close(): Promise; } export interface LocalWhisperAudioOptions { readonly signal?: AbortSignal; /** Cloud provider selected for the cloud-openai backend. */ readonly cloudProvider?: string; /** Injectable for tests; production uses AudioContext or webkitAudioContext. */ readonly createAudioContext?: () => LocalWhisperAudioContext; } /** * Prepare the MediaRecorder payload for the selected ASR backend. * Local Whisper, Tencent Cloud standard recording, Xiaomi MiMo, and Volcano * Engine recording-file recognition get browser-decoded PCM WAV; other cloud * providers keep the original MediaRecorder codec. */ export declare function prepareRecordedAudioForBackend(backend: MediaCaptureBackend, audio: RecordedAudioPayload, options?: LocalWhisperAudioOptions): Promise; /** Keep the final send guard in one small, directly testable place. */ export declare function isTranscriptionStillCurrent(options: { readonly mounted: boolean; readonly signal: AbortSignal; readonly captureIsCurrent: boolean; }): boolean; /** * Decode a browser MediaRecorder payload and convert it to mono 16 kHz * PCM16 WAV for the Host-side local Whisper runtime. */ export declare function normalizeRecordedAudioForLocalWhisper(audio: RecordedAudioPayload, options?: LocalWhisperAudioOptions): Promise; export {};