Assets/Watson/Scripts/Services/TextToSpeech/TextToSpeech.cs
/// <summary>
/// Creates a new empty custom voice model that is owned by the requesting user.
/// Note: This method is currently a beta release that supports US English only.
/// </summary>
/// <param name="callback">The callback.</param>
/// <param name="name">Name of the new custom voice model.</param>
/// <param name="language">Language of the new custom voice model. Omit the parameter to use the default language, en-US. = ['de-DE', 'en-US', 'en-GB', 'es-ES', 'es-US', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR'].</param>
/// <param name="description">Description of the new custom voice model.</param>
/// <param name="customData">Optional custom data.</param>
/// <returns></returns>
Creates a new empty custom voice model that is owned by the requesting user.
Note: This method is currently a beta release that supports US English only.
Creates a new empty custom voice model that is owned by the requesting user . Note : This method is currently a beta release that supports US English only .
public bool CreateCustomization(CreateCustomizationCallback callback, string name, string language = default(string), string description = default(string), string customData = default(string))
		{
			if (callback == null)
				throw new ArgumentNullException("callback");
			if (string.IsNullOrEmpty(name))
				throw new ArgumentNullException("A name is required to create a custom voice model.");
			CustomVoice customVoice = new CustomVoice();
			customVoice.name = name;
			customVoice.language = language;
			customVoice.description = description;
			fsData data;
			sm_Serializer.TrySerialize(customVoice.GetType(), customVoice, out data).AssertSuccessWithoutWarnings();
			string customizationJson = fsJsonPrinter.CompressedJson(data);
			CreateCustomizationRequest req = new CreateCustomizationRequest();
			req.Callback = callback;
			req.CustomVoice = customVoice;
			req.Data = customData;
			req.Headers["Content-Type"] = "application/json";
			req.Headers["Accept"] = "application/json";
			req.Send = Encoding.UTF8.GetBytes(customizationJson);
			req.OnResponse = OnCreateCustomizationResp;
			RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, "/v1/customizations");
			if (connector == null)
				return false;
			return connector.Send(req);
		}
public bool CreateCustomization ( CreateCustomizationCallback callback , string name , string language = default ( string ) , string description = default ( string ) , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( name ) ) throw new ArgumentNullException ( " " ) ; CustomVoice customVoice = new CustomVoice ( ) ; customVoice . name = name ; customVoice . language = language ; customVoice . description = description ; fsData data ; sm_Serializer . TrySerialize ( customVoice . GetType ( ) , customVoice , out data ) . AssertSuccessWithoutWarnings ( ) ; string customizationJson = fsJsonPrinter . CompressedJson ( data ) ; CreateCustomizationRequest req = new CreateCustomizationRequest ( ) ; req . Callback = callback ; req . CustomVoice = customVoice ; req . Data = customData ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Send = Encoding . UTF8 . GetBytes ( customizationJson ) ; req . OnResponse = OnCreateCustomizationResp ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , " " ) ; if ( connector == null ) return false ; return connector . Send ( req ) ; }
Creates a new empty custom voice model that is owned by the requesting user.
Creates a new empty custom voice model that is owned by the requesting user .
None
callback
CreateCustomizationCallback
None
name
string
Name of the new custom voice model.
Name of the new custom voice model .
language
string
Language of the new custom voice model. Omit the parameter to use the default language, en-US.
Language of the new custom voice model . Omit the parameter to use the default language en - US .
description
string
Description of the new custom voice model.
Description of the new custom voice model .
customData
string
Optional custom data.
Optional custom data .