use-speech-vue3
v0.0.2
Published
```shell npm i use-speech-vue3 ``` ```shell yarn add use-speech-vue3 ``` ```shell pnpm i use-speech-vue3 ```
Downloads
4
Readme
安装
npm i use-speech-vue3
yarn add use-speech-vue3
pnpm i use-speech-vue3
import {useSpeechRecognition} from "use-speech-vue3";
const onSTTResult = (result?: string) => {
console.log(result)
}
/**
* autoRestart: 识别意外中断后是否自动重新开始识别
*/
const {results, speeching, speechTimer, start, stop} = useSpeechRecognition({ onresult: onSTTResult, autoRestart: true })
// 开始识别
await start()
// 停止识别
const content = await stop()