diff --git a/snippets_archive/speechSynthesis.md b/snippets_archive/speechSynthesis.md deleted file mode 100644 index 18f2229f8..000000000 --- a/snippets_archive/speechSynthesis.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: speechSynthesis -tags: browser,intermediate ---- - -Performs speech synthesis (experimental). - -Use `SpeechSynthesisUtterance.voice` and `window.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 speechSynthesis = message => { - const msg = new SpeechSynthesisUtterance(message); - msg.voice = window.speechSynthesis.getVoices()[0]; - window.speechSynthesis.speak(msg); -}; -``` - -```js -speechSynthesis('Hello, World'); // // plays the message -``` \ No newline at end of file diff --git a/test/speechSynthesis.test.js b/test/speechSynthesis.test.js deleted file mode 100644 index f5a6c29e1..000000000 --- a/test/speechSynthesis.test.js +++ /dev/null @@ -1,5 +0,0 @@ -const {speechSynthesis} = require('./_30s.js'); - -test('speechSynthesis is a Function', () => { - expect(speechSynthesis).toBeInstanceOf(Function); -});