Chrome的语音合成不能脱机工作吗? [英] Can't Chrome's speechSynthesis work offline?

查看:380
本文介绍了Chrome的语音合成不能脱机工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩Chrome的语音合成功能

  msg =新的SpeechSynthesisUtterance(some text); 
msg.lang =fr-FR;
window.speechSynthesis.speak(msg);

当我发现这个奇怪的问题时:如果您的设备处于脱机状态,则无法再说话。我搜索了网页,但没有找到任何解释。

无法离线工作吗?

(如果您知道它需要在线的原因,请告诉我)

解决方案

语音合成语音可以是本地设备,也可以是远程语音合成器服务。如果语音是远程服务,浏览器将只能使用它,如果它在线并可以连接到它。



你不说你是哪个环境但在Windows和OS X上将用于FR-FR的GoogleFrançais语音是远程服务,因此它不能脱机工作。

您可以通过调用 speechSynthesis.getVoices()并检查<$每个语音的c $ c> localService 属性。


I was playing with Chrome's speechSynthesis

msg = new SpeechSynthesisUtterance("some text");
msg.lang = "fr-FR" ;
window.speechSynthesis.speak(msg);  

when I discovered this strange issue : it can't speak anymore if your device is offline. I searched the web but did not find any explanation.
Can't this work offline ?
(If you know the reason why it needs to be online, please tell me it too in the comments.)

解决方案

Speech synthesis voices are either local on the device or come from remote speech synthesizer services. If the voice is a remote service, the browser will only be able to use it if it is online and can connect to it.

You don't say which environment you are on, but the Google Français voice that would be used for fr-FR on Windows and OS X is a remote service, so it doesn't work offline.

You can check which voices are available on a device by calling speechSynthesis.getVoices() and checking the localService property for each voice.

这篇关于Chrome的语音合成不能脱机工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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