beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
17 lines (16 loc) • 570 B
TypeScript
export declare type UseSpeechSynthesisOptions = {
rate?: number;
pitch?: number;
volume?: number;
voice?: SpeechSynthesisVoice;
};
export declare type SpeechSynthesisResult = {
speak: () => void;
speechSynthUtterance: SpeechSynthesisUtterance;
};
/**
* Enables the possibility to perform a text-to-speech (with different voices) operation in your
* React component by using the Web_Speech_API
*/
declare const useSpeechSynthesis: (text: string, options?: UseSpeechSynthesisOptions) => SpeechSynthesisResult;
export default useSpeechSynthesis;