mathrok
Version:
AI-powered symbolic mathematics library combining traditional Computer Algebra System (CAS) capabilities with natural language processing for math problem solving
85 lines • 1.92 kB
TypeScript
/**
* Text-to-Speech module for Mathrok
* Provides audio explanation capabilities using Web Speech API with fallbacks
*/
interface TextToSpeechOptions {
voice?: string;
rate?: number;
pitch?: number;
volume?: number;
language?: string;
}
interface VoiceInfo {
id: string;
name: string;
language: string;
default: boolean;
}
/**
* Text to speech service
*/
export declare class TextToSpeech {
private synthesis;
private isSupported;
private isSpeaking;
private availableVoices;
private options;
constructor(options?: Partial<TextToSpeechOptions>);
/**
* Initialize speech synthesis
*/
private initializeSpeechSynthesis;
/**
* Load available voices
*/
private loadVoices;
/**
* Check if speech synthesis is supported
*/
isSynthesisSupported(): boolean;
/**
* Get available voices
*/
getVoices(): VoiceInfo[];
/**
* Get voice by language
*/
getVoiceByLanguage(language: string): VoiceInfo | null;
/**
* Speak text
*/
speak(text: string, options?: Partial<TextToSpeechOptions>): Promise<void>;
/**
* Stop speaking
*/
stop(): void;
/**
* Pause speaking
*/
pause(): void;
/**
* Resume speaking
*/
resume(): void;
/**
* Check if currently speaking
*/
isSpeakingNow(): boolean;
/**
* Speak mathematical expression with special handling
*/
speakMathExpression(expression: string, explanation?: string): Promise<void>;
/**
* Process mathematical expressions for better speech output
*/
private processMathExpressionForSpeech;
/**
* Speak step-by-step solution
*/
speakStepByStepSolution(steps: {
text: string;
expression: string;
}[]): Promise<void>;
}
export {};
//# sourceMappingURL=text-to-speech.d.ts.map