【问题标题】:Google Chrome (Windows) - how to add missing speech synthesis voicesGoogle Chrome (Windows) - 如何添加缺失的语音合成声音
【发布时间】:2017-12-05 13:01:21
【问题描述】:

我在 Google Chrome (Windows) 中使用 HTML5 语音合成 API。不幸的是,当我测试可用的声音时 - 我看不到挪威语 声音(例如)

所以我的问题是 - 是否可以添加缺失的声音 在铬?或者该列表是否适用于所有 Chrome (Windows) 安装?

在我的 Android 设备上 - 可用声音的列表要大得多。 但是 - 在 Windows 设备上 - 一些重要的声音丢失了。

我在 Windows 版 Google Chrome 上看到的声音如下:

PL-PL zh-CN 去DE zh-CN 英文版 英文版 ES-ES es-US FR-FR 高输入 身份证号 资讯科技 日本日本语 ko-KR NL-NL PL-PL PT-BR RU-RU ZH-CN 中港 zh-TW

谢谢, 迈克

【问题讨论】:

    标签: html google-chrome text-to-speech speech-synthesis


    【解决方案1】:

    该列表是特定于浏览器版本的,以及同一浏览器的版本,例如Chrome 在不同的操作系统上会有不同的列表。似乎只有 Safari 和 Chrome 是多语言的,Opera 和 Firefox 有英文语音,而 IE 没有。 Mac 和 Ubuntu 的 Chrome 比 Windows 的 Chrome 有更多的声音。可能较新版本的 Chrome 比旧版本有更多的声音。

    我写了一个显示浏览器声音的 jsbin:
    https://jsbin.com/ginanegoqu/edit?js,output

    if ('speechSynthesis' in window) {
        // Start an html table for languages details
        var text = '<table border=1><tr><th>Default<th>Language<th>Local<th>Name<th>URI</tr>';
        // Get voices; add to table markup
        function loadVoices() {
            var voices = speechSynthesis.getVoices();
            voices.forEach(function(voice, i) {
              // Add all details to table
              text += '<tr><td>' + voice.default + '<td>'
                  + voice.lang + '<td>' + voice.localService
                  + '<td>' + voice.name + '<td>' + voice.voiceURI;
            });
        }
        loadVoices();
        langList.innerHTML = text;
        // Chrome loads voices asynchronously.
        window.speechSynthesis.onvoiceschanged = function(e) {
            loadVoices();
            langList.innerHTML = text;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-30
      • 2019-09-12
      • 2010-10-21
      • 1970-01-01
      • 2021-04-21
      • 2012-03-31
      • 2022-01-23
      相关资源
      最近更新 更多