I use the SpeechSynthesisUtterance with JavaScript and HTML. I want to speak out numbers properly, so instead of it reading five three seven seven nine, like fivtythreethousand sevenhundered, and seventy nine. Is that possible? I am getting the number from a localStorage. I am using this code:
var msg = new SpeechSynthesisUtterance("The number is " + localStorage.getItem("mynumber"));
msg.lang = 'en-US';
msg.rate = 4;
window.speechSynthesis.speak(msg);
`
How the number is pronounced depends on the browser and the voice selected from that browser. When I try in Chrome the default voice says "fiftythree seventyseven nine", however if I give the number a thousands separator (i.e. change it from 53779 to 53,779) all voices say "fiftythree thousand seven hundred and seventynine."
Therefore try adding ".toLocaleString('en')" which adds the thousand separator:
var msg = new SpeechSynthesisUtterance("The number is " + localStorage.getItem("mynumber").toLocaleString('en'));