/** * Voice processing module — STT (Speech-to-Text) and TTS (Text-to-Speech) * * STT providers: * 1. Edge STT (free, via edge-stt or Whisper local) * 2. Volcano Engine / Doubao STT (best Chinese, ~¥0.01/req) * 3. OpenAI Whisper API ($0.006/min) * 4. Local Whisper (free, needs model download) * * TTS providers: * 1. edge-tts (free, Microsoft voices, excellent Chinese) * 2. Volcano Engine TTS (Doubao voices) * 3. OpenAI TTS ($0.015/1K chars) * * Default: Whisper API for STT + edge-tts for TTS (best quality/cost ratio) */ export interface VoiceConfig { sttProvider: 'whisper-api' | 'whisper-local' | 'volcano' | 'azure' | 'none'; ttsProvider: 'edge-tts' | 'volcano' | 'openai-tts' | 'azure' | 'none'; /** OpenAI API key for Whisper */ openaiApiKey?: string; /** OpenAI base URL */ openaiBaseUrl?: string; /** Volcano Engine credentials */ volcanoAppId?: string; volcanoToken?: string; volcanoCluster?: string; /** Azure Speech credentials */ azureSpeechKey?: string; azureSpeechRegion?: string; /** Whisper model for local inference */ whisperModel?: string; /** TTS voice name */ ttsVoice?: string; /** TTS language */ ttsLang?: string; /** Temp directory for audio files */ tempDir?: string; /** Ollama base URL for local Whisper */ ollamaUrl?: string; } export declare class VoiceProcessor { private config; constructor(config?: Partial); /** * Convert speech audio to text (STT) * @param audioPath Path to audio file (.ogg, .mp3, .wav, .m4a) * @returns Transcribed text */ speechToText(audioPath: string): Promise; /** * Convert text to speech audio (TTS) * @param text Text to convert * @returns Path to generated audio file (.mp3) */ textToSpeech(text: string): Promise; /** Check if voice processing is available */ isSTTAvailable(): boolean; isTTSAvailable(): boolean; private whisperApiSTT; private whisperLocalSTT; private volcanoSTT; private azureSTT; private edgeTTS; private openaiTTS; private volcanoTTS; private azureTTS; private checkEdgeTTS; private checkOllamaWhisper; /** Download a file from URL to local path */ downloadFile(url: string, destPath: string): Promise; /** Cleanup temp files */ cleanup(): void; } export declare function createVoiceProcessor(config?: Partial): VoiceProcessor; export { VoiceProcessor as VoiceChannel }; export { createVoiceProcessor as createVoiceProviders }; export declare class EdgeTTSProvider { name: string; private voice; constructor(voice?: string); synthesize(text: string): Promise; } export declare class WhisperSTTProvider { private apiKey?; name: string; constructor(apiKey?: string | undefined); transcribe(audio: Buffer): Promise; } export declare class OpenAITTSProvider { private apiKey?; private voice?; name: string; constructor(apiKey?: string | undefined, voice?: string | undefined); synthesize(text: string): Promise; } //# sourceMappingURL=voice.d.ts.map