Class Engine
Definition
- Namespace:
- Tizen.Uix.TtsEngine
- Assembly:
- Tizen.Uix.TtsEngine.dll
- API Level:
- 4
This class represents the TTS engine, which has to be inherited to make the engine.
C#Copypublic abstract class Engine
- Inheritance
-
System.ObjectEngine
Constructors
Declaration
C#Copypublic Engine()
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
Methods
Declaration
C#Copypublic abstract Error CancelSynthesis()
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
API Level: 4
CheckAppAgreed(String, out Boolean)
Called when the engine service user requests for the TTS engine to check whether the application agreed the usage of the TTS engine. This callback function is called when the engine service user requests for the TTS engine to check the application's agreement about using the the engine. According to the need, the engine developer can provide some user interfaces to check the agreement.
Declaration
C#Copypublic abstract Error CheckAppAgreed(string appid, out bool isAgreed)
Parameters
Type | Name | Description |
---|---|---|
System.String | appid | The application ID. |
System.Boolean | isAgreed | A variable for checking whether the application agreed to use the TTS engine or not. true to agree, false to disagree. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
Remarks
If the TTS engine developer does not want to check the agreement, the developer needs to return proper values as isAgreed in accordance with the intention. true if the developer regards that every application agreed the usage of the engine, false if the developer regards that every application disagreed. NOTE that, however, there may be any legal issue unless the developer checks the agreement. Therefore, we suggest that the engine developers should provide a function to check the agreement.
API Level: 4
Declaration
C#Copypublic abstract Error Deinitialize()
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
Remarks
NOTE that the engine may be terminated automatically. When this callback function is invoked, the release of the resources is necessary.
API Level: 4
EngineMain(Int32, String[])
Main function for the Text-To-Speech (TTS) engine. This function is the main function for operating the TTS engine.
Declaration
C#Copypublic void EngineMain(int argc, string[] argv)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | argc | The argument count (original). |
System.String[] | argv | The argument (original). |
Remarks
ServiceAppMain should be used for working the engine after this function.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | Thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
ForEachSupportedVoices(Engine.SupportedVoice, IntPtr)
Called when the engine service user gets the whole supported voice list.
Declaration
C#Copypublic abstract Error ForEachSupportedVoices(Engine.SupportedVoice callback, IntPtr userData)
Parameters
Type | Name | Description |
---|---|---|
Engine.SupportedVoice | callback | The callback function. |
System.IntPtr | userData | The user data which must be passed to SupportedVoice(). |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
Remarks
In this function, the engine service user's callback function 'SupportedVoice()' is invoked repeatedly for getting all the supported voices, and userData must be transferred to 'SupportedVoice()'. If 'SupportedVoice()' returns false, it should be stopped to call 'SupportedVoice()'.
API Level: 4
GetInformation(out String, out String, out String, out Boolean)
Called when the engine service user requests the basic information of the TTS engine.
Declaration
C#Copypublic abstract Error GetInformation(out string engineUuid, out string engineName, out string engineSetting, out bool useNetwork)
Parameters
Type | Name | Description |
---|---|---|
System.String | engineUuid | UUID of the engine. |
System.String | engineName | Name of the engine. |
System.String | engineSetting | The engine setting application (UI application)'s ID. |
System.Boolean | useNetwork | The status for using the network. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
Remarks
The allocated engineUuid, engineName, and engineSetting will be released internally. In order to upload the engine at Tizen Appstore, both a service application and a UI application are necessary. Therefore, engineSetting must be transferred to the engine service user.
API Level: 4
GetPitchRange(out Int32, out Int32, out Int32)
Gets the pitch range from the Tizen platform.
Declaration
C#Copypublic void GetPitchRange(out int min, out int normal, out int max)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | min | The minimum pitch value. |
System.Int32 | normal | The normal pitch value. |
System.Int32 | max | The maximum pitch value. |
Remarks
This API is used when the TTS engine wants to get the pitch range from the Tizen platform.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | Thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
GetSpeedRange(out Int32, out Int32, out Int32)
Gets the speed range from the Tizen platform.
Declaration
C#Copypublic void GetSpeedRange(out int min, out int normal, out int max)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | min | The minimum speed value. |
System.Int32 | normal | The normal speed value. |
System.Int32 | max | The maximum speed value. |
Remarks
This API is used when the TTS engine wants to get the speed range from the Tizen platform.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | Thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
Declaration
C#Copypublic abstract Error Initialize()
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
API Level: 4
IsValidVoice(String, Int32, out Boolean)
Called when the engine service user checks whether the voice is valid or not in the TTS engine.
Declaration
C#Copypublic abstract Error IsValidVoice(string language, int type, out bool isValid)
Parameters
Type | Name | Description |
---|---|---|
System.String | language | The language is specified as an ISO 3166 alpha-2 two-letter country code followed by an ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English. |
System.Int32 | type | The voice type. |
System.Boolean | isValid | A variable for checking whether the corresponding voice is valid or not. true to be valid, false to be invalid. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
API Level: 4
LoadVoice(String, Int32)
Called when the engine service user requests to load the corresponding voice type for the first time.
Declaration
C#Copypublic abstract Error LoadVoice(string language, int type)
Parameters
Type | Name | Description |
---|---|---|
System.String | language | The language is specified as an ISO 3166 alpha-2 two-letter country code followed by an ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English. |
System.Int32 | type | The voice type. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
API Level: 4
NeedAppCredential()
Called when the engine service user checks whether the TTS engine needs the application's credentials.
Declaration
C#Copypublic abstract bool NeedAppCredential()
Returns
Type | Description |
---|---|
System.Boolean | true if TTS engine needs the application's credentials, otherwise false. |
API Level: 4
Declaration
C#Copypublic void SendError(Error error, string msg)
Parameters
Type | Name | Description |
---|---|---|
Error | error | The error reason. |
System.String | msg | The error message. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | Thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
SendResult(ResultEvent, IntPtr, Int32, AudioType, Int32)
Sends the synthesized result to the engine service user.
Declaration
C#Copypublic void SendResult(ResultEvent resultEvent, IntPtr data, int dataSize, AudioType audioType, int rate)
Parameters
Type | Name | Description |
---|---|---|
ResultEvent | resultEvent | The result event. |
System.IntPtr | data | The result data. |
System.Int32 | dataSize | The result data size. |
AudioType | audioType | The audio type. |
System.Int32 | rate | The sample rate. |
Remarks
This API is used in StartSynthesis(), when the TTS engine sends the synthesized result to the engine service user. The synthesized result must be transferred to the engine service user through this function.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | Thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
SetPitch(Int32)
Called when the engine service user sets the default pitch of the TTS engine.
Declaration
C#Copypublic abstract Error SetPitch(int pitch)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pitch | The default pitch. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
API Level: 4
SetPrivateDataRequestedDelegate(Engine.OutAction<String>)
Sets a callback function for setting the private data.
Declaration
C#Copypublic void SetPrivateDataRequestedDelegate(Engine.OutAction<string> callback)
Parameters
Type | Name | Description |
---|---|---|
Engine.OutAction<System.String> | callback | The callback function. Called when the TTS engine receives the private data from the engine service user. This callback function is called when the engine service user sends the private data to the TTS engine. Out parameters: a = Key -- The key field of private data. b = data -- The data field of private data. The following error codes can be returned:
|
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
SetPrivateDataSetDelegate(Engine.Action<String>)
Sets a callback function for setting the private data.
Declaration
C#Copypublic void SetPrivateDataSetDelegate(Engine.Action<string> callback)
Parameters
Type | Name | Description |
---|---|---|
Engine.Action<System.String> | callback | Called when the engine service user gets the private data from the TTS engine. In parameters: a = Key -- The key field of private data. b = data -- The data field of private data. The following error codes can be returned:
|
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.NotSupportedException | Thrown in case of not supported. |
System.InvalidOperationException | thrown in case of operation failure. |
API Level: 4
Feature: http://tizen.org/feature/speech.synthesis
StartSynthesis(String, Int32, String, Int32, String, String, IntPtr)
Called when the engine service user starts to synthesize a voice, asynchronously.
Declaration
C#Copypublic abstract Error StartSynthesis(string language, int type, string text, int speed, string appid, string credential, IntPtr userData)
Parameters
Type | Name | Description |
---|---|---|
System.String | language | The language is specified as an ISO 3166 alpha-2 two-letter country code followed by an ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English. |
System.Int32 | type | The voice type. |
System.String | text | Texts. |
System.Int32 | speed | The speed of speaking. |
System.String | appid | The application ID. |
System.String | credential | The credential granted to the application. |
System.IntPtr | userData | The user data which must be passed to the SendResult() function. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|
Remarks
In this callback function, the TTS engine must transfer the synthesized result to the engine service user using SendResult(). Also, if the TTS engine needs the application's credential, it can set the credential granted to the application.
API Level: 4
UnloadVoice(String, Int32)
Called when the engine service user requests to unload the corresponding voice type or to stop using voice.
Declaration
C#Copypublic abstract Error UnloadVoice(string language, int type)
Parameters
Type | Name | Description |
---|---|---|
System.String | language | The language is specified as an ISO 3166 alpha-2 two-letter country code followed by an ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English. |
System.Int32 | type | The voice type. |
Returns
Type | Description |
---|---|
Error | The following error codes can be returned:
|