/** * Speech & Transcription - AI SDK v6 Compatible * * Provides speech generation and transcription utilities. */ export interface GenerateSpeechOptions { /** Model to use (e.g., 'openai/tts-1', 'elevenlabs/eleven_multilingual_v2') */ model: string; /** Text to convert to speech */ text: string; /** Voice to use */ voice?: string; /** Speed multiplier (0.25 to 4.0) */ speed?: number; /** Output format */ format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'; /** Additional provider options */ providerOptions?: Record; } export interface GenerateSpeechResult { /** Audio data as Uint8Array */ audio: Uint8Array; /** Audio format */ format: string; /** Duration in seconds (if available) */ durationSeconds?: number; /** Provider metadata */ providerMetadata?: Record; } export interface TranscribeOptions { /** Model to use (e.g., 'openai/whisper-1') */ model: string; /** Audio data - can be Uint8Array, ArrayBuffer, Buffer, base64 string, or URL */ audio: Uint8Array | ArrayBuffer | Buffer | string; /** Language hint (ISO 639-1 code) */ language?: string; /** Prompt to guide transcription */ prompt?: string; /** Temperature for sampling */ temperature?: number; /** Output format */ format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt'; /** Additional provider options */ providerOptions?: Record; } export interface TranscribeResult { /** Transcribed text */ text: string; /** Detected language */ language?: string; /** Duration in seconds */ durationSeconds?: number; /** Segments with timestamps */ segments?: TranscriptionSegment[]; /** Provider metadata */ providerMetadata?: Record; } export interface TranscriptionSegment { /** Segment ID */ id: number; /** Start time in seconds */ start: number; /** End time in seconds */ end: number; /** Segment text */ text: string; /** Confidence score */ confidence?: number; } /** * Generate speech from text. * * @example * ```typescript * const result = await generateSpeech({ * model: 'openai/tts-1', * text: 'Hello, world!', * voice: 'alloy' * }); * * // Save to file * await fs.writeFile('speech.mp3', result.audio); * ``` */ export declare function generateSpeech(options: GenerateSpeechOptions): Promise; /** * Transcribe audio to text. * * @example * ```typescript * const result = await transcribe({ * model: 'openai/whisper-1', * audio: await fs.readFile('audio.mp3') * }); * * console.log(result.text); * ``` */ export declare function transcribe(options: TranscribeOptions): Promise; /** * Available speech models. */ export declare const SPEECH_MODELS: { openai: { 'tts-1': { description: string; voices: string[]; }; 'tts-1-hd': { description: string; voices: string[]; }; }; elevenlabs: { eleven_multilingual_v2: { description: string; voices: never[]; }; eleven_turbo_v2: { description: string; voices: never[]; }; }; }; /** * Available transcription models. */ export declare const TRANSCRIPTION_MODELS: { openai: { 'whisper-1': { description: string; languages: string; }; }; };