语音合成 JavaScriptApi
概述
语音合成相关接口,JavaScript 对应对象为 window.TTS
语音合成
void startSpeaking(String voiceName, String warnSound, int volume, int speed, int pitch, int digitMode, int count, String text)
开始语音合成。
参数
| Param | Description |
|---|---|
| voiceName | 发音人: 男声 - xiaofeng 女声 - xiaoyan |
| warnSound | 提示音开关: on - 打开 off - 关闭 |
| volume | 音量:0~100 |
| speed | 语速:0~100 |
| pitch | 语调:0~100 |
| count | 重复次数 |
| text | 内容 |
调用示例
window.TTS.startSpeaking("xiaoyan", "off", 100, 50, 50, 50, 1, "你好,欢迎使用语音合成接口");
停止语音合成
void stopSpeaking()
调用该方法会立即停止语音合成。
调用示例
window.TTS.stopSpeaking();