Class VoiceControlClient
Definition
- Namespace:
- Tizen.Uix.VoiceControl
- Assembly:
- Tizen.Uix.VoiceControl.dll
- API Level:
- 3
A main function of the voice control API registers the command and gets a notification for the recognition result. Applications can add their own commands and provide results when their command is recognized by the user voice input.
C#Copypublic static class VoiceControlClient
- Inheritance
-
System.ObjectVoiceControlClient
Properties
CurrentLanguage
Gets the current language. A 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. An empty string is returned in case of some internal error.
Declaration
C#Copypublic static string CurrentLanguage { get; }
Property Value
Type | Description |
---|---|
System.String | The current language in voice control. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Precondition: The state must be initialized or ready.
Declaration
C#Copypublic static ServiceState ServiceState { get; }
Property Value
Type | Description |
---|---|
ServiceState | The current state of the voice control service. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Precondition: The state must be ready.
Declaration
C#Copypublic static State State { get; }
Property Value
Type | Description |
---|---|
State | The current state of the voice control client. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Precondition: The state must be initialized or ready.
Methods
Declaration
C#Copypublic static void Deinitialize()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.InvalidOperationException | This exception can be due to operation failed. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Declaration
C#Copypublic static RecognitionResult GetResult()
Returns
Type | Description |
---|---|
RecognitionResult | The recognition result if possible, else a null object. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.ArgumentException | This exception can be due to an invalid parameter. |
System.NotSupportedException | This exception can be due to not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
Feature: http://tizen.org/feature/speech.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
GetSupportedLanguages()
Retrieves all the supported languages. A 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 static IEnumerable<string> GetSupportedLanguages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.InvalidOperationException | This exception can be due to operation failed. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready or initialized.
Declaration
C#Copypublic static VoiceCommandList GetSystemCommandList()
Returns
Type | Description |
---|---|
VoiceCommandList | The command list, else null in case of no system commands. |
Remarks
In the system command list, there are system commands predefined by product manufacturers. Those commands have the highest priority. Therefore, the user cannot set any commands similar to system commands.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.InvalidOperationException | This exception can be due to operation failed. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic static void Initialize()
Exceptions
Type | Condition |
---|---|
System.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 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.control http://tizen.org/feature/microphone
Postcondition: The state will be initialized.
Declaration
C#Copypublic static void Prepare()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.InvalidOperationException | This exception can be due to operation failed. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be initialized.
Postcondition: The state must be ready.
RequestDialog(String, String, Boolean)
Requests to start the dialogue. By using this function, the developer can start requesting the dialogue to the framework. When the developer requests the dialogue, two types of texts, dispText and uttText can be sent by this function. dispText is a text for displaying and uttText is that for uttering. For example, if dispText is "October 10th" and uttText is "Today is October 10th.", "October 10th" will be displayed on the screen and "Today is October 10th." will be spoken. Also, the developer can set whether the dialogue starts automatically or not, using autoStart. If the developer sets autoStart as True, the framework will start to record the next speech and continue the dialogue.
Declaration
C#Copypublic static void RequestDialog(string dispText, string uttText, bool autoStart)
Parameters
Type | Name | Description |
---|---|---|
System.String | dispText | Text to be displayed on the screen. |
System.String | uttText | Text to be spoken. |
Boolean | autoStart | A variable for setting whether the dialog session will be restarted automatically or not. |
Remarks
If autoStart is True, the recognition will start again. In this case, it can be restarted up to 4 times.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.ArgumentException | This exception can be due to an invalid parameter. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic static void SetCommandList(VoiceCommandList list, CommandType type)
Parameters
Type | Name | Description |
---|---|---|
VoiceCommandList | list | Command list |
CommandType | type | Command type |
Remarks
The command type is valid for CommandType 'Foreground' or 'Background'. The matched commands of the command list should be set and they should include type and command text at least.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.ArgumentException | This exception can be due to an invalid parameter. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic static void SetInvocationName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Invocation name to be invoked by an application. |
Remarks
The invocation name is used to activate background commands. The invocation name can be same as the application name or any other phrase. For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample". In order to activate the background command, users can say "Tizen Sample, Play music". The invocation name is dependent on the current language. For example, if the current language is "en_US"(English), the invocation name is also "en_US". If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized. This function should be called before the SetCommandList().
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.ArgumentException | This exception can be due to an invalid parameter. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
Declaration
C#Copypublic static void Unprepare()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state must be ready.
Postcondition: The state must be initialized.
Declaration
C#Copypublic static void UnsetCommandList(CommandType type)
Parameters
Type | Name | Description |
---|---|---|
CommandType | type | Command type |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This exception can be due to an invalid state. |
System.ArgumentException | This exception can be due to an invalid parameter. |
System.NotSupportedException | This exception can be due to 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.control http://tizen.org/feature/microphone
Precondition: The state should be ready.
Events
Declaration
C#Copypublic static event EventHandler<CurrentLanguageChangedEventArgs> CurrentLanguageChanged
Event Type
Type | Description |
---|---|
System.EventHandler<CurrentLanguageChangedEventArgs> |
API Level: 3
Precondition: The state must be initialized.
Declaration
C#Copypublic static event EventHandler<ErrorOccuredEventArgs> ErrorOccured
Event Type
Type | Description |
---|---|
System.EventHandler<ErrorOccuredEventArgs> |
API Level: 3
Precondition: The state must be initialized.
Declaration
C#Copypublic static event EventHandler<RecognitionResultEventArgs> RecognitionResult
Event Type
Type | Description |
---|---|
System.EventHandler<RecognitionResultEventArgs> |
API Level: 3
Precondition: The state must be initialized.
Declaration
C#Copypublic static event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ServiceStateChangedEventArgs> |
API Level: 3
Precondition: The state must be initialized.
Declaration
C#Copypublic static event EventHandler<StateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<StateChangedEventArgs> |