import { type AIMLAPIClient } from '../client'; /** * Base text-to-speech parameters */ export interface TextToSpeechParams { model: string; text?: string; script?: string; } /** * Unified Text-to-Speech create parameters interface * Following the same approach as images and speech-to-text resources */ export interface TextToSpeechCreateParams extends TextToSpeechParams { voice?: string; container?: string; encoding?: 'linear16' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'flac' | 'aac'; sample_rate?: string; apply_text_normalization?: 'auto' | 'on' | 'off'; next_text?: string; previous_text?: string; output_format?: 'mp3_22050_32' | 'mp3_44100_32' | 'mp3_44100_64' | 'mp3_44100_96' | 'mp3_44100_128' | 'mp3_44100_192' | 'pcm_8000' | 'pcm_16000' | 'pcm_22000' | 'pcm_24000' | 'pcm_44100' | 'pcm_48000' | 'ulaw_8000' | 'alaw_8000' | 'opus_48000_32' | 'opus_48000_64' | 'opus_48000_96' | 'opus_48000_128' | 'opus_48000_192'; voice_settings?: { stability?: number; use_speaker_boost?: boolean; similarity_boost?: number; style?: number; speed?: number; }; seed?: number; format?: 'wav' | 'mp3'; script?: string; speakers?: Array<{ preset?: string; audio_url?: string; }>; cfg_scale?: number; style?: string; response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'; speed?: number; } /** * Text-to-speech creation response */ export interface TextToSpeechCreateResponse { audio: { url: string; }; meta?: { usage?: { credits_used: number; }; }; } /** * Text-to-speech streaming response (for models that return raw audio) */ export interface TextToSpeechStreamResponse { audio: Buffer; meta?: { usage?: { credits_used: number; }; }; } /** * Text-to-speech response metadata */ export interface TextToSpeechMetadata { transaction_key: string; request_id: string; sha256: string; created: string; duration: number; channels: number; models: string[]; model_info: Record; } /** * Text-to-speech response with metadata */ export interface TextToSpeechResponse { metadata: TextToSpeechMetadata; } /** * Text-to-Speech resource class * Handles text-to-speech API calls with unified parameter interface */ export declare class TextToSpeech { private readonly _client; constructor(_client: AIMLAPIClient); /** * Create text-to-speech audio (JSON response) * @example * ```typescript * const result = await client.textToSpeech.create({ * model: 'openai/tts-1', * text: 'Hello, world!', * voice: 'alloy' * }); * ``` */ create(params: TextToSpeechCreateParams, options?: any): Promise; /** * Create text-to-speech audio (streaming response for models that support it) * @example * ```typescript * const result = await client.textToSpeech.createStream({ * model: '#g1_aura-athena-en', * text: 'Hello, world!', * encoding: 'mp3' * }); * ``` */ createStream(params: TextToSpeechCreateParams, options?: any): Promise; /** * Transform unified parameters to API-specific format * Filters out undefined parameters and handles model-specific transformations */ private _transformToApiParams; /** * Check if model returns streaming audio response */ private _isStreamingModel; } //# sourceMappingURL=text-to-speech.d.ts.map