ttc-ai-client
Version:
TypeScript client sdk for TTC AI services with decorators and schema validation.
73 lines • 1.82 kB
TypeScript
/**
* Simple Voice Call Manager
* A clean, minimal wrapper around ttc-sc for voice conversations
*/
export interface VoiceCallOptions {
conversationId: string;
token: string;
serverUrl?: string;
onUserSpeech?: (text: string) => void;
onAssistantResponse?: (text: string) => void;
onCallStart?: () => void;
onCallEnd?: () => void;
onError?: (error: string) => void;
onStatusChange?: (status: string) => void;
}
export declare class VoiceCallManager {
private client;
private isActive;
private isListening;
private isSpeaking;
private isMuted;
private isProcessing;
private transcriptQueue;
private options;
constructor(options: VoiceCallOptions);
/**
* Start the voice call
*/
startCall(): Promise<boolean>;
/**
* End the voice call
*/
endCall(): void;
/**
* Send assistant response for TTS playback
*/
respondWithSpeech(text: string): Promise<void>;
/**
* Get current call state
*/
getState(): {
isActive: boolean;
isListening: boolean;
isSpeaking: boolean;
isMuted: boolean;
isProcessing: boolean;
queuedTranscripts: number;
};
/**
* Process a single transcript
*/
private processTranscript;
/**
* Handle playback completion and process queued transcripts
*/
private onPlaybackComplete;
/**
* Mute the microphone by disabling all audio tracks
*/
private muteMicrophone;
/**
* Unmute the microphone by enabling all audio tracks
*/
private unmuteMicrophone;
private startListening;
private stopListening;
private onSpeechComplete;
/**
* Destroy and clean up resources
*/
destroy(): void;
}
//# sourceMappingURL=index.d.ts.map