Class TtsClient
Definition
- Namespace:
- Tizen.Uix.Tts
- Assembly:
- Tizen.Uix.Tts.dll
- API Level:
- 3
You can use Text-To-Speech (TTS) API's to read sound data transformed by the engine from input texts. Applications can add input-text to queue for reading continuously and control the player that can play, pause, and stop sound data synthesized from text.
C#Copypublic class TtsClient : IDisposable
- Inheritance
-
System.ObjectTtsClient
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic TtsClient()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
OutOfMemoryException | This exception can be due to out Of memory. |
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Properties
Declaration
C#Copypublic Mode CurrentMode { get; set; }
Property Value
Type | Description |
---|---|
Mode | The current TTS mode (default, screen-reader, notification). |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons while setting the value:
|
OutOfMemoryException | This exception can be due to out Of memory. |
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Precondition: The State should be created.
Declaration
C#Copypublic State CurrentState { get; }
Property Value
Type | Description |
---|---|
State | The current state of TTS. |
API Level: 3
Declaration
C#Copypublic SupportedVoice DefaultVoice { get; }
Property Value
Type | Description |
---|---|
SupportedVoice | The default voice in TTS. |
API Level: 3
Declaration
C#Copypublic bool IsScreenReaderOn { get; }
Property Value
Type | Description |
---|---|
System.Boolean | The current status of screen reader. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 9
Feature: http://tizen.org/feature/speech.synthesis
Declaration
C#Copypublic uint MaxTextSize { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | The Maximum byte size for text. |
API Level: 3
Precondition: The State should be ready.
Methods
Declaration
C#Copypublic int AddText(string text, string language, int voiceType, int speed)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | An input text based UTF-8. |
System.String | language | The language selected from the SupportedVoice.Language Property obtained from GetSupportedVoices()(e.g. 'NULL'(Automatic),'en_US'). |
System.Int32 | voiceType | The voice type selected from the SupportedVoice.VoiceType Property obtained from GetSupportedVoices(). |
System.Int32 | speed | A speaking speed (e.g.0 for Auto or the value from SpeedRange Property). |
Returns
Type | Description |
---|---|
System.Int32 | The utterance ID. |
Remarks
Locale MUST be set for UTF-8 text validation check.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | This exception can be due to improper value provided while setting the value. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready or playing or paused.
Declaration
C#Copypublic void Dispose()
API Level: 3
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | The boolean value for destoying tts handle. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic string GetPrivateData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key string. |
Returns
Type | Description |
---|---|
System.String | The data corresponding to the provided key. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready.
Declaration
C#Copypublic SpeedRange GetSpeedRange()
Returns
Type | Description |
---|---|
SpeedRange | The SpeedRange value. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be created.
Declaration
C#Copypublic IEnumerable<SupportedVoice> GetSupportedVoices()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SupportedVoice> | The list of SupportedVoice. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Declaration
C#Copypublic void Pause()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be playing.
Postcondition: If this function succeeds, the TTS state will be Paused.
Declaration
C#Copypublic void Play()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready or paused.
Postcondition: If this function succeeds, the TTS state will be playing.
Declaration
C#Copypublic void Prepare()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The State must be Created.
Postcondition: If this function is successful, the TTS state will be ready. If this function is unsuccessful, ErrorOccurred event will be invoked.
Declaration
C#Copypublic void SetCredential(string credential)
Parameters
Type | Name | Description |
---|---|---|
System.String | credential | . The credential string. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.NotSupportedException | This exception can be due to TTS not supported. |
System.ArgumentException | This exception can be due to improper value provided while setting the value. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The State should be created or ready.
Declaration
C#Copypublic void SetPrivateData(string key, string data)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key string. |
System.String | data | The data string. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
System.ArgumentException | This exception can be due to improper value provided while setting the value. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready.
Declaration
C#Copypublic void Stop()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready or playing or paused.
Postcondition: If this function succeeds, the TTS state will be ready. This function will remove all text added via AddText() and synthesized sound data.
Declaration
C#Copypublic void Unprepare()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.NotSupportedException | This exception can be due to TTS not supported. |
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The state must be ready.
Postcondition: If this function is successful, the TTS state will be created.
Events
Declaration
C#Copypublic event EventHandler<DefaultVoiceChangedEventArgs> DefaultVoiceChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DefaultVoiceChangedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<EngineChangedEventArgs> EngineChanged
Event Type
Type | Description |
---|---|
System.EventHandler<EngineChangedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<ErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<ErrorOccurredEventArgs> |
API Level: 4
Declaration
C#Copypublic event EventHandler<ScreenReaderChangedEventArgs> ScreenReaderChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ScreenReaderChangedEventArgs> |
API Level: 9
Declaration
C#Copypublic event EventHandler<StateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<StateChangedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<UtteranceEventArgs> UtteranceCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<UtteranceEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<UtteranceEventArgs> UtteranceStarted
Event Type
Type | Description |
---|---|
System.EventHandler<UtteranceEventArgs> |