Class SttClient
Definition
- Namespace:
- Tizen.Uix.Stt
- Assembly:
- Tizen.Uix.Stt.dll
- API Level:
- 3
A main function of Speech-To-Text (below STT) API recognizes sound data recorded by users. After choosing a language, the applications will start recording and recognizing. After recording, the applications will receive the recognized result. The STT has a client-server for the service of multi-applications. The STT service always works in the background as a server. If the service is not working, client library will invoke it and the client will communicate with it. The service has engines and a recorder, so that the client does not have the recorder itself. Only the client request commands to the STT service for using STT.
C#Copypublic class SttClient : IDisposable
- Inheritance
-
System.ObjectSttClient
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic SttClient()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to operation failed. |
OutOfMemoryException | This exception can be due to out of memory. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Properties
Declaration
C#Copypublic State CurrentState { get; }
Property Value
Type | Description |
---|---|
State | Current state of STT. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
DefaultLanguage
Gets the default language set by the user. The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English.
Declaration
C#Copypublic string DefaultLanguage { get; }
Property Value
Type | Description |
---|---|
System.String | Default language in STT. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Declaration
C#Copypublic string Engine { get; set; }
Property Value
Type | Description |
---|---|
System.String | Current STT engine id. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exceptioncan occur while setting due to the following reasons:
|
OutOfMemoryException | This exception can be due to out of memory. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | This can happen if improper EngineId is provided while setting the value. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Precondition: The state must be created.
Declaration
C#Copypublic float RecordingVolume { get; }
Property Value
Type | Description |
---|---|
Single | Recording volume in STT. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Precondition: The state must be recording.
Methods
Cancel()
Cancels processing the recognition and recording asynchronously. This function cancels recording and the engine cancels recognition processing. After successful cancellation, the StateChanged event is invoked, otherwise if an error is occurs, the ErrorOccurred event is invoked.
Declaration
C#Copypublic void Cancel()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be Recording or Processing.
Postcondition: It will invoke the StateChanged event, if registered. If this function succeeds, the STT state will be ready. If you call this function again before the state changes, you will receive ErrorINProgressToReady.
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 stt handle. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic IEnumerable<ResultTime> GetDetailedResult()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ResultTime> | List of ResultTime. |
Remarks
This function should only be called in the RecognitionResult event.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to operation failed. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
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 key is provided. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to invalid state. |
System.NotSupportedException | This exception can be due to STT not supported. |
System.TimeoutException | This exception can be due to No Answer from STT Service. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic IEnumerable<SupportedEngine> GetSupportedEngines()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SupportedEngine> | IEnumerable<SupportedEngine> list of supported engines. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to operation failed. |
OutOfMemoryException | This exception can be due to out of memory. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
GetSupportedLanguages()
Retrieves all the supported languages of the current engine. The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. For example, "ko_KR" for Korean, "en_US" for American English.
Declaration
C#Copypublic IEnumerable<string> GetSupportedLanguages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | List of strings for supported languages. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
IsRecognitionTypeSupported(RecognitionType)
Checks whether the recognition type is supported.
Declaration
C#Copypublic bool IsRecognitionTypeSupported(RecognitionType type)
Parameters
Type | Name | Description |
---|---|---|
RecognitionType | type | RecognitionType value. |
Returns
Type | Description |
---|---|
System.Boolean | Bool value indicating whether the recognition type is supported. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
Declaration
C#Copypublic void Prepare()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to invalid state. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state must be created.
Postcondition: If this function is successful, the STT 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 |
---|---|
InvalidOperationException | This exceptioncan be due to the following reasons:
|
OutOfMemoryException | This exception can be due to out of memory. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | This can happen if Improper value is provided while setting the value. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state must be created.
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 |
---|---|
InvalidOperationException | This exception can be due to invalid state. |
System.NotSupportedException | This exception can be due to STT not supported. |
System.TimeoutException | This exception can be due to No Answer from STT Service. |
System.ArgumentException | This can happen if Improper value is provided while setting the value. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic void SetSilenceDetection(SilenceDetection type)
Parameters
Type | Name | Description |
---|---|---|
SilenceDetection | type | SilenceDetection value. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
SetStartSound(String)
Sets the sound to start recording. Sound file type should be .wav type.
Declaration
C#Copypublic void SetStartSound(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | File path for the sound. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | If an Invalid Parameter is provided. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
SetStopSound(String)
Sets the sound to stop recording. Sound file type should be .wav type.
Declaration
C#Copypublic void SetStopSound(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | File Path for the sound. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | This exception can be due to Invalid Parameter. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
Start(String, RecognitionType)
Starts the recording and recognition asynchronously. This function starts recording in the STT service and sends the recording data to the engine. This work continues until stop, cancel, or silence is detected by engine.
Declaration
C#Copypublic void Start(string language, RecognitionType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | language | The language selected. |
RecognitionType | type | The type for recognition. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
System.ArgumentException | This exception can be due to an invalid language. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
Postcondition: It will invoke the StateChanged event, if registered. If this function succeeds, the STT state will be recording. If you call this function again before the state changes, you will receive ErrorINProgressToRecording.
Stop()
Finishes the recording and starts recognition processing in the engine asynchronously.
Declaration
C#Copypublic void Stop()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be Recording.
Postcondition: It will invoke the StateChanged Event, if registered. If this function succeeds, the STT state will be processing. If you call this function again before the state changes, you will receive ErrorINProgressToProcessing. After processing of engine, the RecognitionResult event is invoked.
Declaration
C#Copypublic void Unprepare()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to invalid state. |
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state must be ready.
Postcondition: If this function is successful, the STT state will be Created.
Declaration
C#Copypublic void UnsetStartSound()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | This exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
Declaration
C#Copypublic void UnsetStopSound()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This exception can be due to the following reasons:
|
System.NotSupportedException | This exception can be due to STT not supported. |
UnauthorizedAccessException | his exception can be due to permission denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.recognition http://tizen.org/feature/microphone
Precondition: The state should be ready.
Events
Declaration
C#Copypublic event EventHandler<DefaultLanguageChangedEventArgs> DefaultLanguageChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DefaultLanguageChangedEventArgs> |
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<RecognitionResultEventArgs> RecognitionResult
Event Type
Type | Description |
---|---|
System.EventHandler<RecognitionResultEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<StateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<StateChangedEventArgs> |