如何使用 Web Speech API 添加语音 [英] How to add a voice using Web Speech API
问题描述
我一直在阅读 Web Speech Api 文档 我已经做了一些例子,但我想改变声音但不是标准系统声音(通过执行 SpeechSynthesis.getVoices() 获得的声音).SpeechSynthesisVoice 对象具有表示语音合成服务的 voiceURI 属性.我认为我需要制作一个 SpeechSynthesisVoice 对象来指示我的语音合成服务,但我不知道如何制作或在哪里可以找到.问题是:是否有任何开源平台提供该功能,或者我必须使用浏览器提供的声音(通过执行 SpeechSynthesis.getVoices() 获得的声音)?
I've been reading the Web Speech Api documentation and I've done some examples but i would like to change the voice but not for a standard system voice (voices getting by executing SpeechSynthesis.getVoices()). The SpeechSynthesisVoice object has the voiceURI property that indicates the speech synthesis service. I think that i need to make a SpeechSynthesisVoice object indicating my speech synthesis service but i don't know how to make one or where can I found one. The question is: Is there any open source platform that provides that or I must use the voices provided by the browser (voices getting by executing SpeechSynthesis.getVoices()) ?
推荐答案
在当前的规范草案中,SpeechSynthesisVoice
对象只有只读字段.浏览器和操作系统的每种组合都有不同类型的语音合成机制,每种组合都有不同类型的语音.
In the current draft specification, the SpeechSynthesisVoice
object has only read-only fields. Each combination of browser and operating system has different type of speech synthesis mechanisms and each one of them has different types of voices.
如果你想控制语音,你需要使用外部服务器.我使用了 CloudASR,它非常适合语音合成和语音识别.它也很容易使用,因为您只需安装 Docker 容器并运行它即可.
If you want to control the voice you need to use external server. I've used CloudASR and it works perfectly for both speech synthesis and speech recognition. It's also very easy to play with because all you need to do it to install a Docker container and simply run it.
这篇关于如何使用 Web Speech API 添加语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!