Mike79
Mike79

Reputation: 99

Google Chrome (Windows) - how to add missing speech synthesis voices

I use HTML5 speech synthesis API with Google Chrome (Windows). Unfortunattely, when I test available voices - I don't see norwegian voice (for example)

So my question is - is it possible to add missing voices in Chrome? Or is the list valid for all Chrome (Windows) installations?

On my Android device - the list of available voices is much bigger. However - on Windows device - some important voices are missing.

Voices I see on Google Chrome for Windows are listed below:

pl-PL en-US de-DE en-US en-GB en-GB es-ES es-US fr-FR hi-IN id-ID it-IT ja-JP ko-KR nl-NL pl-PL pt-BR ru-RU zh-CN zh-HK zh-TW

Thank you, Mike

Upvotes: 2

Views: 1822

Answers (1)

Frazer
Frazer

Reputation: 1089

The list is browser version specific, and versions of the same browser e.g. Chrome will have a different list on different OSs. It seems only Safari and Chrome are multi-lingual, Opera and Firefox have English voices, and IE has none. Chrome for Mac and Ubuntu has many more voices than Chrome for Windows. Presumably newer versions of Chrome have more voices than older.

I wrote a jsbin showing a browser's voices:
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;
    }
}

Upvotes: 4

Related Questions