UNPKG

slanted-gamedev-toolz

Version:

A slanted mix of tools for your brilliant ideas in game design.

16 lines (15 loc) 444 B
import { useCallback } from "react"; import { useSpeechSynthesis } from "react-speech-kit"; export const useSpeech = () => { const { speak: _speak, cancel } = useSpeechSynthesis(); const speak = useCallback((string) => { console.log("Speak:", string); _speak({ text: string, onEnd: () => { console.log("xxx"); }, }); }, [_speak]); return { speak }; };