From 8fe2d0c289ad8a4dfc76029a25f9f4bd2560b47e Mon Sep 17 00:00:00 2001 From: Alan Harnum Date: Tue, 26 Jul 2016 13:08:29 -0400 Subject: [PATCH] FLUID-5935: update configuration of voice to match finalized API w/errata --- src/documents/TextToSpeechAPI.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/documents/TextToSpeechAPI.md b/src/documents/TextToSpeechAPI.md index 6f9bb430..d42a8245 100644 --- a/src/documents/TextToSpeechAPI.md +++ b/src/documents/TextToSpeechAPI.md @@ -457,15 +457,14 @@ fluid.textToSpeech({ -### voiceURI ### - +### voice ### + @@ -479,10 +478,15 @@ fluid.textToSpeech({
Description - The voiceURI attribute is a string that specifies the speech synthesis voice and the location of the speech synthesis service that the web application wishes to use. Calling the getVoices method returns an array of all available voices, from which you can get the value of the voiceURI attribute.
- Note: In Chrome and Safari, the voiceURI attribute is named voice instead. + The voice attribute must be a `SpeechSynthesisVoice` object that specifies the speech synthesis voice that the web application wishes to use. Calling the getVoices method returns an array of all available voices, from which you can select a valid `SpeechSynthesisVoice`.
 
+
+// Assuming an existing textToSpeech component
+var availableVoices = textToSpeech.getVoices();
+var voiceToUse = availableVoices[0];
+
 fluid.textToSpeech({
     model: {
         utteranceOpts: {
-            voiceURI: "Google UK English Male"
+            voice: voiceToUse
         }
     }
 });