The speech API spec says that browsers can decide which voice to use by default, and that each utterance language may have a different default voice.
This attribute is true for at most one voice per language. There may be a different default for each language. It is user agent
dependent how default voices are determined.
The default utterence language is decided by the HTML lang
attribute:
This attribute specifies the language of the speech
synthesis for the utterance, using a valid BCP 47 language tag.
[BCP47] If unset it remains unset for getting in script, but will
default to use the lang of the html document root element and
associated hierachy. This default value is computed and used when the
input request opens a connection to the recognition service.
This implies that, to use a British voice by default:
<html lang="en-GB">
<body>
<script>
var utterance = new SpeechSynthesisUtterance('Toodle pip');
window.speechSynthesis.speak(utterance);
</script>
</body>
</html>
However, this did not change the default voice for me in Chrome 46 (my default language is en-GB
; I also get a German voice by default).
You could use navigator.language
as the default utterance language, but according to this answer it is not a reliable indicator of browser settings (for me it evaluates to en-US
, which is in my list of languages but is not my default).