Tizen Native API
5.0
|
The Voice control manager API provides functions for recording voice and giving responses for recognized voice commands to users.
#include <voice_control_manager.h>
A main function of Voice Control Manager API records voice and gives responses for recognized voice commands. A Voice Control Manager application can start recording user's utterance and get responses from Voice Control engine service. The responses are dependent on the Voice Control engine service. For example, the engine service may send ASR(Automatic Speech Recognition) results or NLU(Natural Language Understanding) results. Also, it may send plural results. Therefore, the application can get various recognition results from the engine service and handle them by showing responses to users or controlling Voice Control applications. Like this, the Voice Control Manager application takes a role of controlling Voice Control applications. For this reason, developers who have an authority granted by Tizen platform can make the Voice Control Manager application.
To use of Voice Control Manager, use the following steps:
1. Initialize
2. Register callback functions for notifications
3. Connect to voice control service asynchronously. The state should be changed to Ready
4. Make command list as the following step and Step 4 is called repeatedly for each command which an application wants
4-1. Create command list handle
4-2. Create command handle
4-3. Set command and type for command handle
4-4. Add command handle to command list
5. Set command list for recognition
6. Get recognition results
7. Request the dialogue
8. If an application wants to finish voice control,
8-1. Destroy command and command list handle
8-2. Deinitialize
An application can obtain command handle from command list, and also get information from handle. The Voice Control API also notifies you (by callback mechanism) when the states of client and service are changed, command is recognized, current language is changed or error occurred. An application should register callback functions: vc_state_changed_cb(), vc_service_state_changed_cb(), vc_mgr_all_result_cb(), vc_mgr_pre_result_cb(), vc_result_cb(), vc_mgr_begin_speech_detected_cb(), vc_current_language_changed_cb(), vc_error_cb(), vc_mgr_dialog_request_cb(), vc_mgr_private_data_set_cb(), vc_mgr_private_data_requested_cb().
FUNCTION | PRE-STATE | POST-STATE | SYNC TYPE |
---|---|---|---|
vc_mgr_initialize() | None | Initialized | SYNC |
vc_mgr_deinitialize() | None, Initialized, Ready | None | SYNC |
vc_mgr_prepare() | Initialized | Ready | ASYNC |
vc_mgr_unprepare() | Ready | Initialized | SYNC |
The following table shows state-dependent function calls. It is forbidden to call functions listed below in wrong states. Violation of this rule may result in an unpredictable behavior.
This API is related with the following features:
Copyright (c) 2011-2018 Samsung Electronics Co., Ltd All Rights Reserved
Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Functions | |
int | vc_mgr_initialize (void) |
Initializes the voice control manager. | |
int | vc_mgr_deinitialize (void) |
Deinitializes the voice control manager. | |
int | vc_mgr_prepare (void) |
Connects the voice control service. | |
int | vc_mgr_unprepare (void) |
Disconnects the voice control service. | |
int | vc_mgr_foreach_supported_languages (vc_supported_language_cb callback, void *user_data) |
Retrieves all supported languages using callback function. | |
int | vc_mgr_get_current_language (char **language) |
Gets the current language set by user. | |
int | vc_mgr_get_state (vc_state_e *state) |
Gets the current state of voice control manager. | |
int | vc_mgr_get_service_state (vc_service_state_e *state) |
Gets the current state of voice control service. | |
int | vc_mgr_is_command_format_supported (int format, bool *support) |
Checks whether the command format is supported. | |
int | vc_mgr_set_command_list (vc_cmd_list_h vc_cmd_list) |
Sets all types of commands. | |
int | vc_mgr_unset_command_list (void) |
Unsets all types of commands. | |
int | vc_mgr_set_command_list_from_file (const char *file_path, int type) |
Sets commands from file. | |
int | vc_mgr_set_preloaded_commands_from_file (const char *file_path) |
Sets background commands of preloaded app from file. | |
int | vc_mgr_get_current_commands (vc_cmd_list_h *vc_cmd_list) |
Retrieves all available commands. | |
int | vc_mgr_set_audio_type (const char *audio_id) |
Sets a type of audio-in. | |
int | vc_mgr_get_audio_type (char **audio_id) |
Gets a type of audio-in. | |
int | vc_mgr_set_recognition_mode (vc_recognition_mode_e mode) |
Sets recognition mode. | |
int | vc_mgr_get_recognition_mode (vc_recognition_mode_e *mode) |
Gets recognition mode. | |
int | vc_mgr_set_private_data (const char *key, const char *data) |
Sets private data to VC engine. | |
int | vc_mgr_get_private_data (const char *key, char **data) |
Gets private data from VC engine. | |
int | vc_mgr_do_action (vc_send_event_type_e type, char *send_event) |
Requests to do action as if utterance is spoken. | |
int | vc_mgr_send_specific_engine_request (const char *engine_app_id, const char *event, const char *request) |
Sends the specific engine request to the vc-service. | |
int | vc_mgr_start (bool exclusive_command_option) |
Starts recognition. | |
int | vc_mgr_stop (void) |
Stops recognition. | |
int | vc_mgr_cancel (void) |
Cancels recognition. | |
int | vc_mgr_get_recording_volume (float *volume) |
Gets the microphone volume during recording. | |
int | vc_mgr_set_selected_results (vc_cmd_list_h vc_cmd_list) |
Selects valid results from all results. | |
int | vc_mgr_set_all_result_cb (vc_mgr_all_result_cb callback, void *user_data) |
Sets a callback function for getting recognition result. | |
int | vc_mgr_unset_all_result_cb (void) |
Unsets the recognition result callback function. | |
int | vc_mgr_set_pre_result_cb (vc_mgr_pre_result_cb callback, void *user_data) |
Sets a callback function for getting pre recognition result. | |
int | vc_mgr_unset_pre_result_cb (void) |
Unsets the pre recognition result callback function. | |
int | vc_mgr_set_specific_engine_result_cb (vc_mgr_specific_engine_result_cb callback, void *user_data) |
Registers a callback function for getting specific engine result. | |
int | vc_mgr_unset_specific_engine_result_cb (void) |
Unregisters the specific engine result callback function. | |
int | vc_mgr_set_result_cb (vc_result_cb callback, void *user_data) |
Sets a callback function for getting all types of recognition results. | |
int | vc_mgr_unset_result_cb (void) |
Unsets the callback function for getting all types of recognition results. | |
int | vc_mgr_set_state_changed_cb (vc_state_changed_cb callback, void *user_data) |
Sets a callback function to be called when state is changed. | |
int | vc_mgr_unset_state_changed_cb (void) |
Unsets the state changed callback function. | |
int | vc_mgr_set_service_state_changed_cb (vc_service_state_changed_cb callback, void *user_data) |
Sets a callback function to be called when service state is changed. | |
int | vc_mgr_unset_service_state_changed_cb (void) |
Unsets the service state changed callback function. | |
int | vc_mgr_set_speech_detected_cb (vc_mgr_begin_speech_detected_cb callback, void *user_data) |
Sets a callback function to be called when begin of speech is detected. | |
int | vc_mgr_unset_speech_detected_cb (void) |
Unsets the speech detected callback function. | |
int | vc_mgr_set_current_language_changed_cb (vc_current_language_changed_cb callback, void *user_data) |
Sets a callback function to be called when current language is changed. | |
int | vc_mgr_unset_current_language_changed_cb (void) |
Unsets the current language changed callback function. | |
int | vc_mgr_get_error_message (char **err_msg) |
Gets the current error message. | |
int | vc_mgr_set_error_cb (vc_error_cb callback, void *user_data) |
Sets a callback function to be called when an error occurred. | |
int | vc_mgr_unset_error_cb (void) |
Unsets the callback function to be called when an error occurred. | |
int | vc_mgr_set_dialog_request_cb (vc_mgr_dialog_request_cb callback, void *user_data) |
Sets a callback function to be called when dialog requests. | |
int | vc_mgr_unset_dialog_request_cb (void) |
Unsets the callback function to be called when dialog requests. | |
int | vc_mgr_enable_command_type (int cmd_type) |
Enables command type as candidate command. | |
int | vc_mgr_disable_command_type (int cmd_type) |
Disables command type as candidate command. | |
int | vc_mgr_set_private_data_set_cb (vc_mgr_private_data_set_cb callback, void *user_data) |
Sets a callback function to be called when engine set private data. | |
int | vc_mgr_unset_private_data_set_cb (void) |
Unsets the callback function to be called when engine set private data. | |
int | vc_mgr_set_private_data_requested_cb (vc_mgr_private_data_requested_cb callback, void *user_data) |
Sets a callback function to be called when engine request private data. | |
int | vc_mgr_unset_private_data_requested_cb (void) |
Unsets the callback function to be called when engine request private data. | |
int | vc_mgr_set_feedback_audio_format_cb (vc_mgr_feedback_audio_format_cb callback, void *user_data) |
Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback. | |
int | vc_mgr_unset_feedback_audio_format_cb (void) |
Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback. | |
int | vc_mgr_set_feedback_streaming_cb (vc_mgr_feedback_streaming_cb callback, void *user_data) |
Sets a callback function to be called when engine sends audio streaming for TTS feedback. | |
int | vc_mgr_unset_feedback_streaming_cb (void) |
Unsets a callback function to be called when engine sends audio streaming for TTS feedback. | |
int | vc_mgr_start_feedback (void) |
Starts getting TTS feedback streaming data from the buffer. | |
int | vc_mgr_stop_feedback (void) |
Stops getting and removes TTS feedback streaming data from the buffer. | |
int | vc_mgr_set_vc_tts_streaming_cb (vc_mgr_vc_tts_streaming_cb callback, void *user_data) |
Sets TTS streaming callback function. | |
int | vc_mgr_unset_vc_tts_streaming_cb (void) |
Unsets TTS streaming callback function. | |
Typedefs | |
typedef bool(* | vc_mgr_all_result_cb )(vc_result_event_e event, vc_cmd_list_h vc_cmd_list, const char *result, const char *msg, void *user_data) |
Called when client gets the all recognition results from voice control service. | |
typedef void(* | vc_mgr_pre_result_cb )(vc_pre_result_event_e event, const char *result, void *user_data) |
Called when client gets the pre recognition results (partial ASR) from voice control service. | |
typedef void(* | vc_mgr_specific_engine_result_cb )(const char *engine_app_id, const char *event, const char *result, void *user_data) |
Called when client gets the specific engine's result from vc-service. | |
typedef void(* | vc_mgr_begin_speech_detected_cb )(void *user_data) |
Called when user speaking is detected. | |
typedef void(* | vc_mgr_dialog_request_cb )(int pid, const char *disp_text, const char *utt_text, bool continuous, void *user_data) |
Called when an application (VC client) requests dialog. | |
typedef int(* | vc_mgr_private_data_set_cb )(const char *key, const char *data, void *user_data) |
Called when engine sets private data to manager client. | |
typedef int(* | vc_mgr_private_data_requested_cb )(const char *key, char **data, void *user_data) |
Called when engine requests private data from manager client. | |
typedef void(* | vc_mgr_feedback_audio_format_cb )(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data) |
Called when engine sends audio formats necessary for playing TTS feedback. | |
typedef void(* | vc_mgr_feedback_streaming_cb )(vc_feedback_event_e event, char *buffer, int len, void *user_data) |
Called when engine sends audio streaming for TTS feedback. | |
typedef void(* | vc_mgr_vc_tts_streaming_cb )(int pid, int utt_id, vc_feedback_event_e event, char *buffer, int len, void *user_data) |
Called when the vc client sends audio streaming for TTS feedback. | |
Defines | |
#define | VC_AUDIO_TYPE_BLUETOOTH "VC_AUDIO_ID_BLUETOOTH" |
Definition of Bluetooth audio-in type. | |
#define | VC_AUDIO_TYPE_WIFI "VC_AUDIO_ID_WIFI" |
Definition of Wi-Fi audio-in type. | |
#define | VC_COMMAND_TYPE_FOREGROUND 1 |
Definition for foreground command type. | |
#define | VC_COMMAND_TYPE_BACKGROUND 2 |
Definition for background command type. | |
#define | VC_COMMAND_TYPE_WIDGET 3 |
Definition for widget command type. | |
#define | VC_COMMAND_TYPE_SYSTEM 4 |
Definition for system command type. | |
#define | VC_COMMAND_TYPE_SYSTEM_BACKGROUND 5 |
Definition for system background command type. | |
#define | VC_COMMAND_TYPE_EXCLUSIVE 6 |
Definition for exclusive command type. | |
#define | VC_RESULT_MESSAGE_NONE "vc.result.message.none" |
Definition for none message. | |
#define | VC_RESULT_MESSAGE_ERROR_TOO_LOUD "vc.result.message.error.too.loud" |
Definition for failed recognition because the speech is too loud to listen. |
#define VC_AUDIO_TYPE_BLUETOOTH "VC_AUDIO_ID_BLUETOOTH" |
Definition of Bluetooth audio-in type.
#define VC_AUDIO_TYPE_WIFI "VC_AUDIO_ID_WIFI" |
Definition of Wi-Fi audio-in type.
#define VC_COMMAND_TYPE_BACKGROUND 2 |
Definition for background command type.
#define VC_COMMAND_TYPE_EXCLUSIVE 6 |
Definition for exclusive command type.
#define VC_COMMAND_TYPE_FOREGROUND 1 |
Definition for foreground command type.
#define VC_COMMAND_TYPE_SYSTEM 4 |
Definition for system command type.
#define VC_COMMAND_TYPE_SYSTEM_BACKGROUND 5 |
Definition for system background command type.
#define VC_COMMAND_TYPE_WIDGET 3 |
Definition for widget command type.
#define VC_RESULT_MESSAGE_ERROR_TOO_LOUD "vc.result.message.error.too.loud" |
Definition for failed recognition because the speech is too loud to listen.
#define VC_RESULT_MESSAGE_NONE "vc.result.message.none" |
Definition for none message.
typedef bool(* vc_mgr_all_result_cb)(vc_result_event_e event, vc_cmd_list_h vc_cmd_list, const char *result, const char *msg, void *user_data) |
Called when client gets the all recognition results from voice control service.
[in] | event | The result event |
[in] | vc_cmd_list | Command list handle |
[in] | result | Command text |
[in] | msg | Engine message (e.g. VC_RESULT_MESSAGE_NONE, VC_RESULT_MESSAGE_ERROR_TOO_LOUD) |
[in] | user_data | The user data passed from the callback registration function |
true
to release command to client, false
to wait for selecting command. typedef void(* vc_mgr_begin_speech_detected_cb)(void *user_data) |
Called when user speaking is detected.
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_dialog_request_cb)(int pid, const char *disp_text, const char *utt_text, bool continuous, void *user_data) |
Called when an application (VC client) requests dialog.
[in] | pid | Pid of VC client to request dialog |
[in] | disp_text | Text requested to be displayed |
[in] | utt_text | Text requested to be spoken |
[in] | continuous | Continue dialog session |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_feedback_audio_format_cb)(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data) |
Called when engine sends audio formats necessary for playing TTS feedback.
[in] | rate | Audio sampling rate |
[in] | channel | Audio channel (e.g. VC_AUDIO_CHANNEL_MONO, VC_AUDIO_CHANNEL_STEREO) |
[in] | audio_type | Audio type (e.g. VC_AUDIO_TYPE_PCM_S16_LE, VC_AUDIO_TYPE_PCM_U8) |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_feedback_streaming_cb)(vc_feedback_event_e event, char *buffer, int len, void *user_data) |
Called when engine sends audio streaming for TTS feedback.
[in] | event | TTS feedback event (e.g. VC_FEEDBACK_EVENT_START, VC_FEEDBACK_EVENT_CONTINUE) |
[in] | buffer | Audio streaming data |
[in] | len | Length of the audio streaming data |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_pre_result_cb)(vc_pre_result_event_e event, const char *result, void *user_data) |
Called when client gets the pre recognition results (partial ASR) from voice control service.
[in] | event | The pre result event |
[in] | result | ASR text |
[in] | user_data | The user data passed from the callback registration function |
typedef int(* vc_mgr_private_data_requested_cb)(const char *key, char **data, void *user_data) |
Called when engine requests private data from manager client.
[in] | key | Private key |
[out] | data | Private data |
[in] | user_data | The user data passed from the callback registration function |
typedef int(* vc_mgr_private_data_set_cb)(const char *key, const char *data, void *user_data) |
Called when engine sets private data to manager client.
[in] | key | Private key |
[in] | data | Private data |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_specific_engine_result_cb)(const char *engine_app_id, const char *event, const char *result, void *user_data) |
Called when client gets the specific engine's result from vc-service.
[in] | engine_app_id | The specific engine's app id |
[in] | event | The specific engine event type |
[in] | result | The specific engine result |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* vc_mgr_vc_tts_streaming_cb)(int pid, int utt_id, vc_feedback_event_e event, char *buffer, int len, void *user_data) |
Called when the vc client sends audio streaming for TTS feedback.
[in] | pid | The process id of the vc client |
[in] | utt_id | The utterance id |
[in] | event | TTS feedback event (e.g. VC_FEEDBACK_EVENT_START, VC_FEEDBACK_EVENT_CONTINUE) |
[in] | buffer | Audio streaming data |
[in] | len | Length of the audio streaming data |
[in] | user_data | The user data passed from the callback registration function |
Enumeration of recognition mode.
enum vc_send_event_type_e |
int vc_mgr_cancel | ( | void | ) |
Cancels recognition.
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Not enough memory |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_IN_PROGRESS_TO_READY | In progress to ready |
VC_ERROR_IN_PROGRESS_TO_RECORDING | In progress to recording |
VC_ERROR_IN_PROGRESS_TO_PROCESSING | In progress to processing |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_deinitialize | ( | void | ) |
Deinitializes the voice control manager.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_disable_command_type | ( | int | cmd_type | ) |
Disables command type as candidate command.
[in] | cmd_type | The command type (e.g. VC_COMMAND_TYPE_FOREGROUND, VC_COMMAND_TYPE_BACKGROUND, VC_COMMAND_TYPE_WIDGET, VC_COMMAND_TYPE_SYSTEM, VC_COMMAND_TYPE_SYSTEM_BACKGROUND, VC_COMMAND_TYPE_EXCLUSIVE) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_do_action | ( | vc_send_event_type_e | type, |
char * | send_event | ||
) |
Requests to do action as if utterance is spoken.
[in] | type | Event type |
[in] | send_event | The string for send event |
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Not enough memory |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_enable_command_type | ( | int | cmd_type | ) |
Enables command type as candidate command.
[in] | cmd_type | The command type (e.g. VC_COMMAND_TYPE_FOREGROUND, VC_COMMAND_TYPE_BACKGROUND, VC_COMMAND_TYPE_WIDGET, VC_COMMAND_TYPE_SYSTEM, VC_COMMAND_TYPE_SYSTEM_BACKGROUND, VC_COMMAND_TYPE_EXCLUSIVE) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_foreach_supported_languages | ( | vc_supported_language_cb | callback, |
void * | user_data | ||
) |
Retrieves all supported languages using callback function.
[in] | callback | Callback function to invoke |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_audio_type | ( | char ** | audio_id | ) |
Gets a type of audio-in.
[out] | audio_id | The audio id (e.g. VC_AUDIO_TYPE_BLUETOOTH or USB device ID) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_current_commands | ( | vc_cmd_list_h * | vc_cmd_list | ) |
Retrieves all available commands.
[in] | vc_cmd_list | The command list |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_current_language | ( | char ** | language | ) |
Gets the current language set by user.
[out] | 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. |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_OUT_OF_MEMORY | Out of memory |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_error_message | ( | char ** | err_msg | ) |
Gets the current error message.
[out] | err_msg | The current error message |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
$VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_OUT_OF_MEMORY | Out of memory |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_private_data | ( | const char * | key, |
char ** | data | ||
) |
Gets private data from VC engine.
[in] | key | Private key |
[out] | data | Private data |
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Not enough memory |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_recognition_mode | ( | vc_recognition_mode_e * | mode | ) |
Gets recognition mode.
[out] | mode | Recognition mode |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_recording_volume | ( | float * | volume | ) |
Gets the microphone volume during recording.
[out] | volume | Recording volume |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_service_state | ( | vc_service_state_e * | state | ) |
Gets the current state of voice control service.
[out] | state | The current state |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_get_state | ( | vc_state_e * | state | ) |
Gets the current state of voice control manager.
[out] | state | The current state |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_initialize | ( | void | ) |
Initializes the voice control manager.
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Out of memory |
VC_ERROR_OPERATION_FAILED | Operation fail |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_is_command_format_supported | ( | int | format, |
bool * | support | ||
) |
Checks whether the command format is supported.
[in] | format | The command format |
[out] | support | The result status true = supported, false = not supported |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_prepare | ( | void | ) |
Connects the voice control service.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_send_specific_engine_request | ( | const char * | engine_app_id, |
const char * | event, | ||
const char * | request | ||
) |
Sends the specific engine request to the vc-service.
[in] | engine_app_id | A specific engine's app id |
[in] | event | A engine service user request event |
[in] | request | A engine service user request text |
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Not enough memory |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_all_result_cb | ( | vc_mgr_all_result_cb | callback, |
void * | user_data | ||
) |
Sets a callback function for getting recognition result.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_audio_type | ( | const char * | audio_id | ) |
Sets a type of audio-in.
[in] | audio_id | The audio type (e.g. VC_AUDIO_TYPE_BLUETOOTH or USB device ID) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_command_list | ( | vc_cmd_list_h | vc_cmd_list | ) |
Sets all types of commands.
[in] | vc_cmd_list | The command list handle |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_command_list_from_file | ( | const char * | file_path, |
int | type | ||
) |
Sets commands from file.
[in] | file_path | The directory of a file which has command list |
[in] | type | The command type (e.g. VC_COMMAND_TYPE_FOREGROUND, VC_COMMAND_TYPE_BACKGROUND, VC_COMMAND_TYPE_WIDGET, VC_COMMAND_TYPE_SYSTEM, VC_COMMAND_TYPE_SYSTEM_BACKGROUND, VC_COMMAND_TYPE_EXCLUSIVE) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_current_language_changed_cb | ( | vc_current_language_changed_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when current language is changed.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_dialog_request_cb | ( | vc_mgr_dialog_request_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when dialog requests.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_error_cb | ( | vc_error_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when an error occurred.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_feedback_audio_format_cb | ( | vc_mgr_feedback_audio_format_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
[in] | callback | Callback function to set |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_feedback_streaming_cb | ( | vc_mgr_feedback_streaming_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when engine sends audio streaming for TTS feedback.
[in] | callback | Callback function to set |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_pre_result_cb | ( | vc_mgr_pre_result_cb | callback, |
void * | user_data | ||
) |
Sets a callback function for getting pre recognition result.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_preloaded_commands_from_file | ( | const char * | file_path | ) |
Sets background commands of preloaded app from file.
[in] | file_path | The directory of a file which has command list |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_private_data | ( | const char * | key, |
const char * | data | ||
) |
Sets private data to VC engine.
[in] | key | Private key |
[in] | data | Private data |
VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Not enough memory |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_private_data_requested_cb | ( | vc_mgr_private_data_requested_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when engine request private data.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_private_data_set_cb | ( | vc_mgr_private_data_set_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when engine set private data.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_recognition_mode | ( | vc_recognition_mode_e | mode | ) |
Sets recognition mode.
[in] | mode | Recognition mode (e.g. VC_RECOGNITION_MODE_STOP_BY_SILENCE is default value) |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_result_cb | ( | vc_result_cb | callback, |
void * | user_data | ||
) |
Sets a callback function for getting all types of recognition results.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_selected_results | ( | vc_cmd_list_h | vc_cmd_list | ) |
Selects valid results from all results.
[in] | vc_cmd_list | The valid result list |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_service_state_changed_cb | ( | vc_service_state_changed_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when service state is changed.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_specific_engine_result_cb | ( | vc_mgr_specific_engine_result_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for getting specific engine result.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_mgr_set_speech_detected_cb | ( | vc_mgr_begin_speech_detected_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when begin of speech is detected.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_state_changed_cb | ( | vc_state_changed_cb | callback, |
void * | user_data | ||
) |
Sets a callback function to be called when state is changed.
[in] | callback | Callback function to register |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_set_vc_tts_streaming_cb | ( | vc_mgr_vc_tts_streaming_cb | callback, |
void * | user_data | ||
) |
Sets TTS streaming callback function.
[in] | callback | The callback function |
[in] | user_data | The user data to be passed to the callback function |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
int vc_mgr_start | ( | bool | exclusive_command_option | ) |
Starts recognition.
[in] | exclusive_command_option | Exclusive command option |
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter. |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_IN_PROGRESS_TO_RECORDING | In progress to recording |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_start_feedback | ( | void | ) |
Starts getting TTS feedback streaming data from the buffer.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_stop | ( | void | ) |
Stops recognition.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_OPERATION_FAILED | Operation failure |
VC_ERROR_IN_PROGRESS_TO_READY | In progress to ready |
VC_ERROR_IN_PROGRESS_TO_RECORDING | In progress to recording |
VC_ERROR_IN_PROGRESS_TO_PROCESSING | In progress to processing |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_stop_feedback | ( | void | ) |
Stops getting and removes TTS feedback streaming data from the buffer.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unprepare | ( | void | ) |
Disconnects the voice control service.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_all_result_cb | ( | void | ) |
Unsets the recognition result callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_command_list | ( | void | ) |
Unsets all types of commands.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_current_language_changed_cb | ( | void | ) |
Unsets the current language changed callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_dialog_request_cb | ( | void | ) |
Unsets the callback function to be called when dialog requests.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_error_cb | ( | void | ) |
Unsets the callback function to be called when an error occurred.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_feedback_audio_format_cb | ( | void | ) |
Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_feedback_streaming_cb | ( | void | ) |
Unsets a callback function to be called when engine sends audio streaming for TTS feedback.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_pre_result_cb | ( | void | ) |
Unsets the pre recognition result callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_private_data_requested_cb | ( | void | ) |
Unsets the callback function to be called when engine request private data.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_private_data_set_cb | ( | void | ) |
Unsets the callback function to be called when engine set private data.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_result_cb | ( | void | ) |
Unsets the callback function for getting all types of recognition results.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_service_state_changed_cb | ( | void | ) |
Unsets the service state changed callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_specific_engine_result_cb | ( | void | ) |
Unregisters the specific engine result callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_mgr_unset_speech_detected_cb | ( | void | ) |
Unsets the speech detected callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_state_changed_cb | ( | void | ) |
Unsets the state changed callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | VC not supported |
int vc_mgr_unset_vc_tts_streaming_cb | ( | void | ) |
Unsets TTS streaming callback function.
VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_STATE | Invalid state |