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#
Copy
public class TtsClient : IDisposable
Inheritance
TtsClient

Constructors

View Source

TtsClient()

Constructor to create a TTS instance.

Declaration
C#
Copy
public TtsClient()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis

Properties

View Source

CurrentMode

The TTS Mode can be set using this property.

Declaration
C#
Copy
public Mode CurrentMode { get; set; }
Property Value
Type Description
Mode

The current TTS mode (default, screen-reader, notification).

API Level: 3
Precondition: The Client must be in the state.
View Source

CurrentServiceState

Gets the current state of TTS service.

Declaration
C#
Copy
public ServiceState CurrentServiceState { get; }
Property Value
Type Description
ServiceState

The current state of TTS service.

API Level: 10
View Source

CurrentState

Gets the current TTS state.

Declaration
C#
Copy
public State CurrentState { get; }
Property Value
Type Description
State

The current state of TTS.

API Level: 3
View Source

DefaultVoice

Gets the default voice set by the user.

Declaration
C#
Copy
public SupportedVoice DefaultVoice { get; }
Property Value
Type Description
SupportedVoice

The default voice in TTS.

API Level: 3
View Source

IsScreenReaderOn

Gets the current status of screen reader.

Declaration
C#
Copy
public bool IsScreenReaderOn { get; }
Property Value
Type Description
Boolean

The current status of screen reader.

API Level: 9
Feature: http://tizen.org/feature/speech.synthesis
View Source

MaxTextSize

Gets the maximum byte size for text.

Declaration
C#
Copy
public uint MaxTextSize { get; }
Property Value
Type Description
UInt32

The Maximum byte size for text.

API Level: 3
Precondition: The Client must be in the state.
View Source

PlayingMode

Sets the current playing mode.

Declaration
C#
Copy
public PlayingMode PlayingMode { get; set; }
Property Value
Type Description
PlayingMode

The current playing mode.

API Level: 11
Feature: http://tizen.org/feature/speech.synthesis
Precondition: If you want to set, the Client must be in the state.

Methods

View Source

AddText(String, String, Int32, Int32)

Adds a text to the queue.

Declaration
C#
Copy
public int AddText(string text, string language, int voiceType, int speed)
Parameters
Type Name Description
String text

An input text.

String language

The language selected from the SupportedVoice.Language Property obtained from GetSupportedVoices()(e.g. 'NULL'(Automatic),'en_US').

Int32 voiceType

The voice type selected from the SupportedVoice.VoiceType Property obtained from GetSupportedVoices().

Int32 speed

A speaking speed (e.g.0 for Auto or the value from SpeedRange Property).

Returns
Type Description
Int32

The utterance ID.

Remarks

Locale MUST be set for text validation check.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the , , or state.
View Source

Dispose()

Method to release resources.

Declaration
C#
Copy
public void Dispose()
API Level: 3
View Source

Dispose(Boolean)

Method to release resources.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

The boolean value for destoying tts handle.

API Level: 3
View Source

Finalize()

Destructor to destroy TtsClient handle.

Declaration
C#
Copy
protected void Finalize()
View Source

GetPrivateData(String)

Gets the private data from TTS engine.

Declaration
C#
Copy
public string GetPrivateData(string key)
Parameters
Type Name Description
String key

The key string.

Returns
Type Description
String

The data corresponding to the provided key.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
View Source

GetSpeedRange()

Gets the speed range.

Declaration
C#
Copy
public SpeedRange GetSpeedRange()
Returns
Type Description
SpeedRange

The SpeedRange value.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
View Source

GetSupportedVoices()

Retrieves all supported voices of the current engine.

Declaration
C#
Copy
public IEnumerable<SupportedVoice> GetSupportedVoices()
Returns
Type Description
IEnumerable<SupportedVoice>

The list of SupportedVoice.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
View Source

Pause()

Pauses the currently playing utterance.

Declaration
C#
Copy
public void Pause()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
Postcondition: If this function succeeds, the Client will be in the state.
View Source

Play()

Starts synthesizing voice from the text and plays the synthesized audio data.

Declaration
C#
Copy
public void Play()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the or state.
Postcondition: If this function succeeds, the Client will be in the state.
View Source

Prepare()

Connects to the TTS service asynchronously.

Declaration
C#
Copy
public void Prepare()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
Postcondition: If this function is successful, the Client will be in the state. If this function is unsuccessful, ErrorOccurred event will be invoked.
View Source

Repeat()

Repeats the last added text.

Declaration
C#
Copy
public RepeatedText Repeat()
Returns
Type Description
RepeatedText

The RepeatedText instance which stores the text to repeat and its utterance ID.

API Level: 10
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
Postcondition: If this function succeeds, the Client will be in the state.
View Source

SetCredential(String)

Sets the application credential.

Declaration
C#
Copy
public void SetCredential(string credential)
Parameters
Type Name Description
String credential

. The credential string.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the or state.
View Source

SetPrivateData(String, String)

Sets the private data to tts engine.

Declaration
C#
Copy
public void SetPrivateData(string key, string data)
Parameters
Type Name Description
String key

The key string.

String data

The data string.

API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
View Source

Stop()

Stops playing the utterance and clears the queue.

Declaration
C#
Copy
public void Stop()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the , , or state.
Postcondition: If this function succeeds, the Client will be in the state. This function will remove all text added via AddText() and synthesized sound data.
View Source

Unprepare()

Disconnects from the TTS service.

Declaration
C#
Copy
public void Unprepare()
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the state.
Postcondition: If this function is successful, the Client will be in the state.

Events

View Source

DefaultVoiceChanged

Event to be invoked when an error occurs.

Declaration
C#
Copy
public event EventHandler<DefaultVoiceChangedEventArgs> DefaultVoiceChanged
Event Type
Type Description
EventHandler<DefaultVoiceChangedEventArgs>
API Level: 3
View Source

EngineChanged

Event to be invoked to detect engine change.

Declaration
C#
Copy
public event EventHandler<EngineChangedEventArgs> EngineChanged
Event Type
Type Description
EventHandler<EngineChangedEventArgs>
API Level: 3
View Source

ErrorOccurred

Event to be invoked when an error occurs.

Declaration
C#
Copy
public event EventHandler<ErrorOccurredEventArgs> ErrorOccurred
Event Type
Type Description
EventHandler<ErrorOccurredEventArgs>
API Level: 4
View Source

ScreenReaderChanged

Event to be invoked to detect screen reader status change.

Declaration
C#
Copy
public event EventHandler<ScreenReaderChangedEventArgs> ScreenReaderChanged
Event Type
Type Description
EventHandler<ScreenReaderChangedEventArgs>
API Level: 9
View Source

ServiceStateChanged

Event to be invoked when the state of TTS service changes.

Declaration
C#
Copy
public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
Event Type
Type Description
EventHandler<ServiceStateChangedEventArgs>
API Level: 10
View Source

StateChanged

Event to be invoked when TTS state changes.

Declaration
C#
Copy
public event EventHandler<StateChangedEventArgs> StateChanged
Event Type
Type Description
EventHandler<StateChangedEventArgs>
API Level: 3
View Source

SynthesizedPcm

Event to be invoked when the synthesized pcm data comes from the engine.

Declaration
C#
Copy
public event EventHandler<SynthesizedPcmEventArgs> SynthesizedPcm
Event Type
Type Description
EventHandler<SynthesizedPcmEventArgs>
API Level: 11
View Source

UtteranceCompleted

Event to be invoked when the utterance completes.

Declaration
C#
Copy
public event EventHandler<UtteranceEventArgs> UtteranceCompleted
Event Type
Type Description
EventHandler<UtteranceEventArgs>
API Level: 3
View Source

UtteranceStarted

Event to be invoked when the utterance starts.

Declaration
C#
Copy
public event EventHandler<UtteranceEventArgs> UtteranceStarted
Event Type
Type Description
EventHandler<UtteranceEventArgs>
API Level: 3

Extension Methods