@@ -29,114 +29,114 @@ void Start ()
2929 {
3030 LogSystem . InstallDefaultReactors ( ) ;
3131
32- //// Get Voices
33- //Log.Debug("ExampleTextToSpeech", "Attempting to get voices.");
34- //m_TextToSpeech.GetVoices(OnGetVoices);
35-
36- //// Get Voice
37- ////string selectedVoice = "en-US_AllisonVoice";
38- //Log.Debug("ExampleTextToSpeech", "Attempting to get voice {0}.", VoiceType.en_US_Allison);
39- //m_TextToSpeech.GetVoice(OnGetVoice, VoiceType.en_US_Allison);
40-
41- //// Get Pronunciation
42- //string testWord = "Watson";
43- //Log.Debug("ExampleTextToSpeech", "Attempting to get pronunciation of {0}", testWord);
44- //m_TextToSpeech.GetPronunciation(OnGetPronunciation, testWord, VoiceType.en_US_Allison);
45-
46- // Get Customizations
47- //Log.Debug("ExampleTextToSpeech", "Attempting to get a list of customizations");
48- //m_TextToSpeech.GetCustomizations(OnGetCustomizations);
49-
50- // Create Customization
51- //Log.Debug("ExampleTextToSpeech", "Attempting to create a customization");
52- //string customizationName = "unity-example-customization";
53- //string customizationLanguage = "en-US";
54- //string customizationDescription = "A text to speech voice customization created within Unity.";
55- //m_TextToSpeech.CreateCustomization(OnCreateCustomization, customizationName, customizationLanguage, customizationDescription);
56-
57- // Delete Customization
58- //Log.Debug("ExampleTextToSpeech", "Attempting to delete a customization");
59- //string customizationIdentifierToDelete = "1476ea80-5355-4911-ac99-ba39162a2d34";
60- //if (!m_TextToSpeech.DeleteCustomization(OnDeleteCustomization, customizationIdentifierToDelete))
61- // Log.Debug("ExampleTextToSpeech", "Failed to delete custom voice model!");
62-
63- // Get Customization
64- //Log.Debug("ExampleTextToSpeech", "Attempting to get a customization");
65- //string customizationIdentifierToGet = "1476ea80-5355-4911-ac99-ba39162a2d34";
66- //if (!m_TextToSpeech.GetCustomization(OnGetCustomization, customizationIdentifierToGet))
67- // Log.Debug("ExampleTextToSpeech", "Failed to get custom voice model!");
68-
69- // Update Customization
70- // Log.Debug("ExampleTextToSpeech", "Attempting to update a customization");
71- // Word word0 = new Word();
72- // word0.word = "hello";
73- // word0.translation = "hullo";
74- // Word word1 = new Word();
75- // word1.word = "goodbye";
76- // word1.translation = "gbye";
77- // Word word2 = new Word();
78- // word2.word = "hi";
79- // word2.translation = "ohiooo";
80- // Word[] words = { word0, word1, word2 };
81- // CustomVoiceUpdate customVoiceUpdate = new CustomVoiceUpdate();
82- // customVoiceUpdate.words = words;
83- // customVoiceUpdate.description = "My updated description";
84- // customVoiceUpdate.name = "My updated name";
85- // string customizationIdToUpdate = "1476ea80-5355-4911-ac99-ba39162a2d34";
86- // if (!m_TextToSpeech.UpdateCustomization(OnUpdateCustomization, customizationIdToUpdate, customVoiceUpdate))
87- // Log.Debug("ExampleTextToSpeech", "Failed to update customization!");
88-
89- // Get Customization Words
90- //Log.Debug("ExampleTextToSpeech", "Attempting to get a customization's words");
91- //string customIdentifierToGetWords = "1476ea80-5355-4911-ac99-ba39162a2d34";
92- //if (!m_TextToSpeech.GetCustomizationWords(OnGetCustomizationWords, customIdentifierToGetWords))
93- // Log.Debug("ExampleTextToSpeech", "Failed to get {0} words!", customIdentifierToGetWords);
94-
95- // Add Customization Words
96- //Log.Debug("ExampleTextToSpeech", "Attempting to add words to a customization");
97- //string customIdentifierToAddWords = "1476ea80-5355-4911-ac99-ba39162a2d34";
98- //Words words = new Words();
99- //Word word0 = new Word();
100- //word0.word = "bananna";
101- //word0.translation = "bunanna";
102- //Word word1 = new Word();
103- //word1.word = "orange";
104- //word1.translation = "arange";
105- //Word word2 = new Word();
106- //word2.word = "tomato";
107- //word2.translation = "tomahto";
108- //Word[] wordArray = { word0, word1, word2 };
109- //words.words = wordArray;
110- //if (!m_TextToSpeech.AddCustomizationWords(OnAddCustomizationWords, customIdentifierToAddWords, words))
111- // Log.Debug("ExampleTextToSpeech", "Failed to add words to {0}!", customIdentifierToAddWords);
112-
113- // Delete Customization Word
114- //Log.Debug("ExampleTextToSpeech", "Attempting to delete customization word from custom voice model.");
115- //string customIdentifierToDeleteWord = "1476ea80-5355-4911-ac99-ba39162a2d34";
116- //string wordToDelete = "goodbye";
117- //if (!m_TextToSpeech.DeleteCustomizationWord(OnDeleteCustomizationWord, customIdentifierToDeleteWord, wordToDelete))
118- // Log.Debug("ExampleTextToSpeech", "Failed to delete {0} from {1}!", wordToDelete, customIdentifierToDeleteWord);
119-
120- // Get Customization Word
121- //Log.Debug("ExampleTextToSpeech", "Attempting to get the translation of a custom voice model's word.");
122- //string customIdentifierToGetWord = "1476ea80-5355-4911-ac99-ba39162a2d34";
123- //string customIdentifierWord = "hello";
124- //if (!m_TextToSpeech.GetCustomizationWord(OnGetCustomizationWord, customIdentifierToGetWord, customIdentifierWord))
125- // Log.Debug("ExampleTextToSpeech", "Failed to get the translation of {0} from {1}!", customIdentifierWord, customIdentifierToGetWord);
126-
127- // Add Customization Word - This is not working. The PUT method is not supported by Unity.
128- //Log.Debug("ExampleTextToSpeech", "Attempting to add a single word and translation to a custom voice model.");
129- //string customIdentifierToAddWordAndTranslation = "1476ea80-5355-4911-ac99-ba39162a2d34";
130- //string word = "grasshopper";
131- //string translation = "guhrasshoppe";
132- //if (!m_TextToSpeech.AddCustomizationWord(OnAddCustomizationWord, customIdentifierToAddWordAndTranslation, word, translation))
133- // Log.Debug("ExampleTextToSpeech", "Failed to add {0}/{1} to {2}!", word, translation, customIdentifierToAddWordAndTranslation);
134-
135-
136- //m_TextToSpeech.Voice = VoiceType.en_US_Allison;
137- //m_TextToSpeech.ToSpeech(m_TestString, HandleToSpeechCallback, true);
138-
139- }
32+ //// Get Voices
33+ //Log.Debug("ExampleTextToSpeech", "Attempting to get voices.");
34+ //m_TextToSpeech.GetVoices(OnGetVoices);
35+
36+ //// Get Voice
37+ ////string selectedVoice = "en-US_AllisonVoice";
38+ //Log.Debug("ExampleTextToSpeech", "Attempting to get voice {0}.", VoiceType.en_US_Allison);
39+ //m_TextToSpeech.GetVoice(OnGetVoice, VoiceType.en_US_Allison);
40+
41+ //// Get Pronunciation
42+ //string testWord = "Watson";
43+ //Log.Debug("ExampleTextToSpeech", "Attempting to get pronunciation of {0}", testWord);
44+ //m_TextToSpeech.GetPronunciation(OnGetPronunciation, testWord, VoiceType.en_US_Allison);
45+
46+ // Get Customizations
47+ //Log.Debug("ExampleTextToSpeech", "Attempting to get a list of customizations");
48+ //m_TextToSpeech.GetCustomizations(OnGetCustomizations);
49+
50+ // Create Customization
51+ //Log.Debug("ExampleTextToSpeech", "Attempting to create a customization");
52+ //string customizationName = "unity-example-customization";
53+ //string customizationLanguage = "en-US";
54+ //string customizationDescription = "A text to speech voice customization created within Unity.";
55+ //m_TextToSpeech.CreateCustomization(OnCreateCustomization, customizationName, customizationLanguage, customizationDescription);
56+
57+ // Delete Customization
58+ //Log.Debug("ExampleTextToSpeech", "Attempting to delete a customization");
59+ //string customizationIdentifierToDelete = "1476ea80-5355-4911-ac99-ba39162a2d34";
60+ //if (!m_TextToSpeech.DeleteCustomization(OnDeleteCustomization, customizationIdentifierToDelete))
61+ // Log.Debug("ExampleTextToSpeech", "Failed to delete custom voice model!");
62+
63+ // Get Customization
64+ //Log.Debug("ExampleTextToSpeech", "Attempting to get a customization");
65+ //string customizationIdentifierToGet = "1476ea80-5355-4911-ac99-ba39162a2d34";
66+ //if (!m_TextToSpeech.GetCustomization(OnGetCustomization, customizationIdentifierToGet))
67+ // Log.Debug("ExampleTextToSpeech", "Failed to get custom voice model!");
68+
69+ // Update Customization
70+ Log . Debug ( "ExampleTextToSpeech" , "Attempting to update a customization" ) ;
71+ Word word0 = new Word ( ) ;
72+ word0 . word = "hello" ;
73+ word0 . translation = "hullo" ;
74+ Word word1 = new Word ( ) ;
75+ word1 . word = "goodbye" ;
76+ word1 . translation = "gbye" ;
77+ Word word2 = new Word ( ) ;
78+ word2 . word = "hi" ;
79+ word2 . translation = "ohiooo" ;
80+ Word [ ] words = { word0 , word1 , word2 } ;
81+ CustomVoiceUpdate customVoiceUpdate = new CustomVoiceUpdate ( ) ;
82+ customVoiceUpdate . words = words ;
83+ customVoiceUpdate . description = "My updated description" ;
84+ customVoiceUpdate . name = "My updated name" ;
85+ string customizationIdToUpdate = "1476ea80-5355-4911-ac99-ba39162a2d34" ;
86+ if ( ! m_TextToSpeech . UpdateCustomization ( OnUpdateCustomization , customizationIdToUpdate , customVoiceUpdate ) )
87+ Log . Debug ( "ExampleTextToSpeech" , "Failed to update customization!" ) ;
88+
89+ // Get Customization Words
90+ //Log.Debug("ExampleTextToSpeech", "Attempting to get a customization's words");
91+ //string customIdentifierToGetWords = "1476ea80-5355-4911-ac99-ba39162a2d34";
92+ //if (!m_TextToSpeech.GetCustomizationWords(OnGetCustomizationWords, customIdentifierToGetWords))
93+ // Log.Debug("ExampleTextToSpeech", "Failed to get {0} words!", customIdentifierToGetWords);
94+
95+ // Add Customization Words
96+ //Log.Debug("ExampleTextToSpeech", "Attempting to add words to a customization");
97+ //string customIdentifierToAddWords = "1476ea80-5355-4911-ac99-ba39162a2d34";
98+ //Words words = new Words();
99+ //Word word0 = new Word();
100+ //word0.word = "bananna";
101+ //word0.translation = "bunanna";
102+ //Word word1 = new Word();
103+ //word1.word = "orange";
104+ //word1.translation = "arange";
105+ //Word word2 = new Word();
106+ //word2.word = "tomato";
107+ //word2.translation = "tomahto";
108+ //Word[] wordArray = { word0, word1, word2 };
109+ //words.words = wordArray;
110+ //if (!m_TextToSpeech.AddCustomizationWords(OnAddCustomizationWords, customIdentifierToAddWords, words))
111+ // Log.Debug("ExampleTextToSpeech", "Failed to add words to {0}!", customIdentifierToAddWords);
112+
113+ // Delete Customization Word
114+ //Log.Debug("ExampleTextToSpeech", "Attempting to delete customization word from custom voice model.");
115+ //string customIdentifierToDeleteWord = "1476ea80-5355-4911-ac99-ba39162a2d34";
116+ //string wordToDelete = "goodbye";
117+ //if (!m_TextToSpeech.DeleteCustomizationWord(OnDeleteCustomizationWord, customIdentifierToDeleteWord, wordToDelete))
118+ // Log.Debug("ExampleTextToSpeech", "Failed to delete {0} from {1}!", wordToDelete, customIdentifierToDeleteWord);
119+
120+ // Get Customization Word
121+ //Log.Debug("ExampleTextToSpeech", "Attempting to get the translation of a custom voice model's word.");
122+ //string customIdentifierToGetWord = "1476ea80-5355-4911-ac99-ba39162a2d34";
123+ //string customIdentifierWord = "hello";
124+ //if (!m_TextToSpeech.GetCustomizationWord(OnGetCustomizationWord, customIdentifierToGetWord, customIdentifierWord))
125+ // Log.Debug("ExampleTextToSpeech", "Failed to get the translation of {0} from {1}!", customIdentifierWord, customIdentifierToGetWord);
126+
127+ // Add Customization Word - This is not working. The PUT method is not supported by Unity.
128+ //Log.Debug("ExampleTextToSpeech", "Attempting to add a single word and translation to a custom voice model.");
129+ //string customIdentifierToAddWordAndTranslation = "1476ea80-5355-4911-ac99-ba39162a2d34";
130+ //string word = "grasshopper";
131+ //string translation = "guhrasshoppe";
132+ //if (!m_TextToSpeech.AddCustomizationWord(OnAddCustomizationWord, customIdentifierToAddWordAndTranslation, word, translation))
133+ // Log.Debug("ExampleTextToSpeech", "Failed to add {0}/{1} to {2}!", word, translation, customIdentifierToAddWordAndTranslation);
134+
135+
136+ //m_TextToSpeech.Voice = VoiceType.en_US_Allison;
137+ //m_TextToSpeech.ToSpeech(m_TestString, HandleToSpeechCallback, true);
138+
139+ }
140140
141141 void HandleToSpeechCallback ( AudioClip clip )
142142 {
0 commit comments