如何在speechSynthesis中添加语音/语言? [英] How do I add a voice / language to speechSynthesis?

查看:1369
本文介绍了如何在speechSynthesis中添加语音/语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Chrome中运行 speechSynthesis.getVoices()时,我会得到一个可能的声音列表。该列表会根据Chrome的计算机和版本而变化。



有什么方法可以扩展支持并添加更多声音吗?



我觉得这可以通过要求用户下载所选语言的语音文件来完成。这样的文件存在吗?



编辑:



这需要适用于Windows和Mac计算机。



它还需要简单,所以没有脚本或任何需要广泛技术知识的东西。我希望有一个下载和安装类型的东西

解决方案

如何从MICROSOFT边缘添加更多的声音FIREFOX(仅限Windows 10秋季创作者更新或更高版本)



您应首先使用show list语音测试:



source reddit.com


When I run speechSynthesis.getVoices() in Chrome, I get a list of possible voices. The list changes depending on the computer and version of Chrome.

Is there any way I can extend support and add more voices?

I feel like this could be done by asking a user to download a voice file for their chosen language. Do such files exist?

Edit:

This needs to work for both Windows and Mac computers.

It also needs to be simple, so no scripts or anything that would require extensive technical knowledge. I'm hoping for a "download and install" type of thing

解决方案

HOW TO ADD MORE VOICE FROM MICROSOFT EDGE TO CHROME AND FIREFOX ( only on windows 10 fall creator update or later)

you should using show list voice test first at: show available voice on browser

chrome have local and server voice, edge have local and can download more, firefox have nothing else but only 3 supported voice locked by windows registy.

Here's the script to unlock:

If your not sure how to run a powershell script:

Click Start

search for 'Powershell'

launch Powershell (Since this is editing a LocalMachine key, you will need to run as admin). Copy and paste the script into the console. Press enter.

$sourcePath = 'HKLM:\software\Microsoft\Speech_OneCore\Voices\Tokens' #Where the OneCore voices live
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' #For 64-bit apps
$destinationPath2 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' #For 32-bit apps
cd $destinationPath
$listVoices = Get-ChildItem $sourcePath
foreach($voice in $listVoices)
{
$source = $voice.PSPath #Get the path of this voices key
copy -Path $source -Destination $destinationPath -Recurse
copy -Path $source -Destination $destinationPath2 -Recurse
}

After running this on my Example machine and restarting, I have the following voices available to the api

Microsoft David Desktop; Microsoft Zira Desktop; Microsoft Zira Mobile; (Same as the desktop counterpart) Microsoft Mark Mobile;

I find these voices to be superior to the Desktop variants, plus variety is always nice

that you can test your new voice here after restart: show available voice on browser

here I can have 10 voices than 3 voices before, on firefox. That even I can install Vietnamese voice with Microsoft An from windows language, and my firefox can read vietnamese as edge.

source reddit.com

这篇关于如何在speechSynthesis中添加语音/语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆