export interface WorldVoiceprintPlaybackChunkLike { chunkIndex: number; chunkCount: number; } export interface WorldVoiceprintAudioDownloadOptions { fetchImpl?: typeof fetch; maxAttempts?: number; timeoutMillis?: number; } /** * Some upstream TTS responses are complete WAV files whose RIFF/data sizes * still contain the streaming sentinel 0x7fffffff. Native mobile players are * lenient about that header, while Chromium can finish loading the Blob and * then never start playback. Repair only impossible sizes using the bytes we * have already downloaded; ordinary WAV files and every other format remain * untouched. */ export declare function normalizeWorldVoiceprintAudioBytes(bytes: Uint8Array): Uint8Array; /** * Downloads the complete short-lived audio response before playback. This is * the browser equivalent of the mobile client writing each chunk to a local * file, and makes the next-chunk prefetch deterministic instead of relying on * an HTMLAudioElement's best-effort preload hint. */ export declare function downloadWorldVoiceprintAudio(url: string, signal: AbortSignal, options?: WorldVoiceprintAudioDownloadOptions): Promise; export interface WorldVoiceprintPlaybackQueueOptions { loadChunk(chunkIndex: number): Promise; playChunk(chunk: TChunk): Promise; isActive(): boolean; } /** * Resolves when one prepared audio element finishes, but reports readiness * only after Chromium confirms that playback actually started. */ export declare function playPreparedWorldVoiceprintAudio(audio: HTMLAudioElement, signal: AbortSignal, onStarted: () => void, startTimeoutMillis?: number): Promise; /** * Plays server-projected World voiceprint chunks in order while loading the * next chunk during the current chunk's playback. */ export declare function playWorldVoiceprintChunkQueue(options: WorldVoiceprintPlaybackQueueOptions): Promise<'completed' | 'cancelled'>; //# sourceMappingURL=world-voiceprint-playback.d.ts.map