Assets/Watson/Scripts/Services/TextToSpeech/TextToSpeech.cs
/// <summary>
/// Returns the phonetic pronunciation for the word specified by the text parameter. You can request 
/// the pronunciation for a specific format. You can also request the pronunciation for a specific
/// voice to see the default translation for the language of that voice or for a specific custom voice
/// model to see the translation for that voice model.
/// Note: This method is currently a beta release that supports US English only.
/// </summary>
/// <param name="callback">The GetPronunciationCallback</param>
/// <param name="text">The text string to pronounce.</param>
/// <param name="voice">Specify a voice to obtain the pronunciation for the specified word in the language of that voice. All voices for the same language (for example, en-US) return the same translation. Do not specify both a voice and a customization_id. Retrieve available voices with the GET /v1/voices method. If this is null, TextToSpeech will default to the set voice.</param>
/// <param name="format">Specify the phoneme set in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the default format. Either ipa or spr.</param>
/// <param name="customization_id">GUID of a custom voice model for which the pronunciation is to be returned. You must make the request with the service credentials of the model's owner. If the word is not defined in the specified voice model, the service returns the default translation for the model's language. Omit the parameter to see the translation for the specified voice with no customization. Do not specify both a voice and a customization_id.</param>
/// <returns></returns>
Returns the phonetic pronunciation for the word specified by the text parameter. You can request
the pronunciation for a specific format. You can also request the pronunciation for a specific
voice to see the default translation for the language of that voice or for a specific custom voice
model to see the translation for that voice model.
Note: This method is currently a beta release that supports US English only.
Returns the phonetic pronunciation for the word specified by the text parameter . You can request the pronunciation for a specific format . You can also request the pronunciation for a specific voice to see the default translation for the language of that voice or for a specific custom voice model to see the translation for that voice model . Note : This method is currently a beta release that supports US English only .
public bool GetPronunciation(GetPronunciationCallback callback, string text, VoiceType? voice = null, string format = "ipa", string customization_id = default(string))
		{
			if (callback == null)
				throw new ArgumentNullException("callback");
			if (string.IsNullOrEmpty(text))
				throw new ArgumentNullException("text");
			if (voice == null)
				voice = m_Voice;
			RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, "/v1/pronunciation");
			if (connector == null)
				return false;
			GetPronunciationReq req = new GetPronunciationReq();
			req.Callback = callback;
			req.Text = text;
			req.Voice = (VoiceType)voice;
			req.Format = format;
			req.Customization_ID = customization_id;
			req.Parameters["text"] = text;
			req.Parameters["voice"] = GetVoiceType((VoiceType)voice);
			req.Parameters["format"] = format;
			if(!string.IsNullOrEmpty(customization_id))
				req.Parameters["customization_id"] = customization_id;
			req.OnResponse = OnGetPronunciationResp;
			return connector.Send(req);
		}
public bool GetPronunciation ( GetPronunciationCallback callback , string text , VoiceType ? voice = null , string format = " " , string customization_id = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( text ) ) throw new ArgumentNullException ( " " ) ; if ( voice == null ) voice = m_Voice ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , " " ) ; if ( connector == null ) return false ; GetPronunciationReq req = new GetPronunciationReq ( ) ; req . Callback = callback ; req . Text = text ; req . Voice = ( VoiceType ) voice ; req . Format = format ; req . Customization_ID = customization_id ; req . Parameters [ " " ] = text ; req . Parameters [ " " ] = GetVoiceType ( ( VoiceType ) voice ) ; req . Parameters [ " " ] = format ; if ( ! string . IsNullOrEmpty ( customization_id ) ) req . Parameters [ " " ] = customization_id ; req . OnResponse = OnGetPronunciationResp ; return connector . Send ( req ) ; }
Returns the phonetic pronunciation for the word specified by the text parameter.
Returns the phonetic pronunciation for the word specified by the text parameter .
None
callback
GetPronunciationCallback
None
text
string
The text string to pronounce.
The text string to pronounce .
voice
VoiceType?
Specify a voice to obtain the pronunciation for the specified word in the language of that voice. All voices for the same language (for example, en-US) return the same translation. Do not specify both a voice and a customization_id. Retrieve available voices with the GET /v1/voices method. If this is null, TextToSpeech will default to the set voice.
Specify a voice to obtain the pronunciation for the specified word in the language of that voice . All voices for the same language ( for example en - US ) return the same translation . Do not specify both a voice and a customization_id . Retrieve available voices with the GET / v1 / voices method . If this is null TextToSpeech will default to the set voice .
format
string
Specify the phoneme set in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the default format. Either ipa or spr.
Specify the phoneme set in which to return the pronunciation . Omit the parameter to obtain the pronunciation in the default format . Either ipa or spr .
customization_id
string
GUID of a custom voice model for which the pronunciation is to be returned. You must make the request with the service credentials of the model's owner. If the word is not defined in the specified voice model, the service returns the default translation for the model's language. Omit the parameter to see the translation for the specified voice with no customization. Do not specify both a voice and a customization_id.
GUID of a custom voice model for which the pronunciation is to be returned . You must make the request with the service credentials of the model ' s owner . If the word is not defined in the specified voice model the service returns the default translation for the model ' s language . Omit the parameter to see the translation for the specified voice with no customization . Do not specify both a voice and a customization_id .