Assets/Watson/Scripts/Services/TextToSpeech/TextToSpeech.cs
/// <summary>
/// Adds a single word and its translation to the custom voice model with the specified `customization_id`. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add a word to the model.
/// Note: This method is currently a beta release that supports US English only.
/// </summary>
/// <param name="callback">The callback.</param>
/// <param name="customizationID">The identifier of the custom voice model to be updated.</param>
/// <param name="words">Words object to add to custom voice model.</param>
/// <param name="customData">Optional custom data.</param>
/// <returns></returns>
Adds a single word and its translation to the custom voice model with the specified `customization_id`. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add a word to the model.
Note: This method is currently a beta release that supports US English only.
Adds a single word and its translation to the custom voice model with the specified ` customization_id ` . A custom model can contain no more than 20 000 entries . Only the owner of a custom voice model can use this method to add a word to the model . Note : This method is currently a beta release that supports US English only .
public bool AddCustomizationWord(AddCustomizationWordCallback callback, string customizationID, string word, string translation, string customData = default(string))
		{
            Log.Error("TextToSpeech", "AddCustomizationWord is not supported. Unity WWW does not support PUT method! Use AddCustomizationWords() instead!");
			if (callback == null)
				throw new ArgumentNullException("callback");
			if (string.IsNullOrEmpty(customizationID))
				throw new ArgumentNullException("customizationID");
			if (string.IsNullOrEmpty(word))
				throw new ArgumentNullException("word");
			if (string.IsNullOrEmpty(translation))
				throw new ArgumentNullException("translation");
			string json = "{\n\t\"translation\":\"" + translation + "\"\n}";
			AddCustomizationWordRequest req = new AddCustomizationWordRequest();
			req.Callback = callback;
			req.CustomizationID = customizationID;
			req.Word = word;
			req.Translation = translation;
			req.Data = customData;
			req.Headers["Content-Type"] = "application/json";
			req.Headers["Accept"] = "application/json";
			req.Headers["X-HTTP-Method-Override"] = "PUT";
			req.Send = Encoding.UTF8.GetBytes(json);
			req.OnResponse = OnAddCustomizationWordResp;
			string service = "/v1/customizations/{0}/words/{1}";
			RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, string.Format(service, customizationID, word));
			if (connector == null)
				return false;
			return connector.Send(req);
		}
public bool AddCustomizationWord ( AddCustomizationWordCallback callback , string customizationID , string word , string translation , string customData = default ( string ) ) { Log . Error ( " " , " " ) ; if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( customizationID ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( word ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( translation ) ) throw new ArgumentNullException ( " " ) ; string json = " \n \t \" \" \" " + translation + " \" \n " ; AddCustomizationWordRequest req = new AddCustomizationWordRequest ( ) ; req . Callback = callback ; req . CustomizationID = customizationID ; req . Word = word ; req . Translation = translation ; req . Data = customData ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Send = Encoding . UTF8 . GetBytes ( json ) ; req . OnResponse = OnAddCustomizationWordResp ; string service = " " ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , string . Format ( service , customizationID , word ) ) ; if ( connector == null ) return false ; return connector . Send ( req ) ; }
Adds a single word and its translation to the custom voice model with the specified `customization_id`.
Adds a single word and its translation to the custom voice model with the specified ` customization_id ` .
None
callback
AddCustomizationWordCallback
None
customizationID
string
The identifier of the custom voice model to be updated.
The identifier of the custom voice model to be updated .
word
string
translation
string
customData
string
Optional custom data.
Optional custom data .
words
Words object to add to custom voice model.
Words object to add to custom voice model .