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.
public class TtsClient : IDisposable
- Inheritance
-
Constructors
View Source
TtsClient()
Constructor to create a TTS instance.
Declaration
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Properties
View Source
CurrentMode
The TTS Mode can be set using this property.
Declaration
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
public ServiceState CurrentServiceState { get; }
Property Value
Type |
Description |
ServiceState |
The current state of TTS service.
|
API Level: 10
Declaration
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
public SupportedVoice DefaultVoice { get; }
Property Value
API Level: 3
View Source
IsScreenReaderOn
Gets the current status of screen reader.
Declaration
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
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.
Declaration
public PlayingMode PlayingMode { get; set; }
Property Value
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
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.
|
API Level: 3
Feature: http://tizen.org/feature/speech.synthesis
Precondition: The Client must be in the , , or state.
Declaration
API Level: 3
View Source
Dispose(Boolean)
Method to release resources.
Declaration
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
protected void Finalize()
View Source
GetPrivateData(String)
Gets the private data from TTS engine.
Declaration
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.
Declaration
public SpeedRange GetSpeedRange()
Returns
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
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
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
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
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.
Declaration
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
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
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
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
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
public event EventHandler<DefaultVoiceChangedEventArgs> DefaultVoiceChanged
Event Type
API Level: 3
View Source
EngineChanged
Event to be invoked to detect engine change.
Declaration
public event EventHandler<EngineChangedEventArgs> EngineChanged
Event Type
API Level: 3
View Source
ErrorOccurred
Event to be invoked when an error occurs.
Declaration
public event EventHandler<ErrorOccurredEventArgs> ErrorOccurred
Event Type
API Level: 4
View Source
ScreenReaderChanged
Event to be invoked to detect screen reader status change.
Declaration
public event EventHandler<ScreenReaderChangedEventArgs> ScreenReaderChanged
Event Type
API Level: 9
View Source
ServiceStateChanged
Event to be invoked when the state of TTS service changes.
Declaration
public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
Event Type
API Level: 10
View Source
StateChanged
Event to be invoked when TTS state changes.
Declaration
public event EventHandler<StateChangedEventArgs> StateChanged
Event Type
API Level: 3
View Source
SynthesizedPcm
Event to be invoked when the synthesized pcm data comes from the engine.
Declaration
public event EventHandler<SynthesizedPcmEventArgs> SynthesizedPcm
Event Type
API Level: 11
View Source
UtteranceCompleted
Event to be invoked when the utterance completes.
Declaration
public event EventHandler<UtteranceEventArgs> UtteranceCompleted
Event Type
API Level: 3
View Source
UtteranceStarted
Event to be invoked when the utterance starts.
Declaration
public event EventHandler<UtteranceEventArgs> UtteranceStarted
Event Type
API Level: 3
Extension Methods