From c5ccd1befb1d0e67f3e7fbb1bf6ee0bfcacdb4ee Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 14 Dec 2017 20:47:23 +0200 Subject: [PATCH] Update and rename Speech_synthesis.md to speech_synthesis-(experimental).md --- snippets/Speech_synthesis.md | 15 --------------- snippets/speech_synthesis-(experimental).md | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 snippets/Speech_synthesis.md create mode 100644 snippets/speech_synthesis-(experimental).md diff --git a/snippets/Speech_synthesis.md b/snippets/Speech_synthesis.md deleted file mode 100644 index 022601472..000000000 --- a/snippets/Speech_synthesis.md +++ /dev/null @@ -1,15 +0,0 @@ -### Speech synthesis - -Currently 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.) - -To know more - https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance - -``` -const speak = message => { - const msg = new SpeechSynthesisUtterance(message); - msg.voice = window.speechSynthesis.getVoices()[0]; - window.speechSynthesis.speak(msg); -} -speak('Hello, World') -``` diff --git a/snippets/speech_synthesis-(experimental).md b/snippets/speech_synthesis-(experimental).md new file mode 100644 index 000000000..74cdcf161 --- /dev/null +++ b/snippets/speech_synthesis-(experimental).md @@ -0,0 +1,15 @@ +### Speech synthesis (experimental) + +Use `SpeechSynthesisUtterance.voice` and `indow.speechSynthesis.getVoices()` to convert a message to speech. +Use `window.speechSynthesis.speak()` to play the message. + +Learn more about the [SpeechSynthesisUtterance interface of the Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance). + +```js +const speak = message => { + const msg = new SpeechSynthesisUtterance(message); + msg.voice = window.speechSynthesis.getVoices()[0]; + window.speechSynthesis.speak(msg); +} +// speak('Hello, World') -> plays the message +```