Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpeechSynthesisUtterance list of languages?

Tags:

javascript

I'm using SpeechSynthesisUtterance in javascript and cannot find a list of the languages supported.

Does anybody know how to get a list of the languages containing the code and the name of the language?

example. English-US en-US Japanese ja-JA

like image 341
Trevor Wood Avatar asked Sep 20 '16 20:09

Trevor Wood


People also ask

What is SpeechSynthesisUtterance in Javascript?

The SpeechSynthesisUtterance interface of the Web Speech API represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.)

How can you prevent speechSynthesis?

cancel() The cancel() method of the SpeechSynthesis interface removes all utterances from the utterance queue. If an utterance is currently being spoken, speaking will stop immediately.

How do I change the voice in SpeechSynthesisUtterance?

To use a voice, set the voice property on your SpeechSynthesisUtterance instance to the desired SpeechSynthesisVoice object. The example below shows how to do this. var utterance = new SpeechSynthesisUtterance('Hello Treehouse'); var voices = window. speechSynthesis.

What is window speechSynthesis?

speechSynthesis. The speechSynthesis read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.


1 Answers

https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/lang

Review this. But to make a very long story short, the language setter/getter returns a BCP-47 language tag. List here. No guarantee that any are particularly supported per a browser, as a comprehensive list of supported values doesn't actually exist.

like image 192
Orpheus Avatar answered Oct 15 '22 02:10

Orpheus