import { type WsSpeechClientOptions } from '../types'; import { type CreateSpeechWsReq, type CreateSpeechWsRes, type WebSocketAPI } from '../..'; declare class WsSpeechClient { ws: WebSocketAPI | null; private listeners; private wavStreamPlayer; private trackId; private api; private totalDuration; private playbackStartTime; private playbackPauseTime; private playbackTimeout; private elapsedBeforePause; private audioDeltaList; private config; constructor(config: WsSpeechClientOptions); init(): Promise>; connect({ voiceId, speechRate, }?: { /**音色ID */ voiceId?: string; /**输出音频的语速,取值范围 [-50, 100],默认为 0。-50 表示 0.5 倍速,100 表示 2 倍速。 */ speechRate?: number; }): Promise; disconnect(): Promise; /** * Releases wavStreamPlayer resources so callers can dispose the instance. * In a mobile browser environment, if the WsSpeechClient is instantiated multiple times, * you can additionally call the destroyPlayer method to release resources and prevent issues with speech playback. */ destroyPlayer(): Promise; append(message: string): void; complete(): void; appendAndComplete(message: string): void; interrupt(): Promise; pause(): Promise; resume(): Promise; togglePlay(): Promise; isPlaying(): boolean; on(event: string, callback: (data: CreateSpeechWsRes | undefined) => void): void; off(event: string, callback: (data: CreateSpeechWsRes | undefined) => void): void; private closeWs; private emit; private handleAudioMessage; } export default WsSpeechClient;