From 992d33f8e85285944ed5e7c485005db4268fb1b0 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 5 Dec 2015 17:12:26 +0000 Subject: [PATCH] Added SpeechSynthesis API --- source/browserapis/speechsynthesis.html.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 source/browserapis/speechsynthesis.html.md diff --git a/source/browserapis/speechsynthesis.html.md b/source/browserapis/speechsynthesis.html.md new file mode 100644 index 0000000..57ec3e1 --- /dev/null +++ b/source/browserapis/speechsynthesis.html.md @@ -0,0 +1,30 @@ +--- +title: Web Speech Synthesis API +short_description: Allows text to be spoken by the computer +tags: media, audio + +w3c_status: W3C Editors Draft +w3c_link: https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#tts-section +caniuse: http://caniuse.com/#feat=speech-synthesis +mdn_docs: https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis +web_platform: # + + +links_tutsarts: + # +links_examples: + # +suggested_uses: + - Acknowledge users actions + - Speak content to users with vision difficulties +--- + + +```js +if('speechSynthesis' in window){ + var synth = window.speechSynthesis; + var msg = new SpeechSynthesisUtterance("Hello, World!"); + msg.lang = "en-GB"; + synth.speak(msg); +} +```