【发布时间】:2015-01-05 08:40:49
【问题描述】:
我开发了包含 Google TTS 的 Google chrome 扩展程序
我用 Crossrider 重写了它,让它在不同的平台上工作(它工作得很好,直到它涉及到 TTS 部分)
这里是代码:
function PlayGoogleTTS(EngWord){
voices = speechSynthesis.getVoices();
msg = new SpeechSynthesisUtterance();
msg.volume = 1; // 0 to 1
msg.rate = 10; // 0.1 to 10
msg.pitch = 2; //0 to 2
msg.text = EngWord;
msg.lang = 'en-US';
msg.voice = voices[1];
msg.voice = voices[1]; // Note: some voices don't support altering params
speechSynthesis.speak(msg);
}
// Fetch the list of voices and populate the voice options.
function loadVoices() {
// Fetch the available voices.
var voices = speechSynthesis.getVoices();
}
// Chrome loads voices asynchronously.
window.speechSynthesis.onvoiceschanged = function(e) {
loadVoices();
};
那么我怎样才能将它转换为在 Crossrider 上工作?
【问题讨论】:
标签: google-chrome-extension cross-browser crossrider