Skip to content

useSpeechSynthesis ​

类别
导出大小
754 B
最近修改
7 months ago

响应式 SpeechSynthesis。

🌐 Reactive SpeechSynthesis.

我可以使用吗?

示例 ​

Hello, everyone! Good morning!




用法 ​

🌐 Usage

ts
import { 
useSpeechSynthesis
} from '@vueuse/core'
const {
isSupported
,
isPlaying
,
status
,
voiceInfo
,
utterance
,
error
,
stop
,
toggle
,
speak
,
} =
useSpeechSynthesis
()

选项 ​

🌐 Options

以下显示了选项的默认值,它们将直接传递给 SpeechSynthesis API。

🌐 The following shows the default values of the options, they will be directly passed to SpeechSynthesis API.

ts
useSpeechSynthesis
({
lang
: 'en-US',
pitch
: 1,
rate
: 1,
volume
: 1,
})
js
'use strict'
useSpeechSynthesis({
  lang: 'en-US',
  pitch: 1,
  rate: 1,
  volume: 1,
})