2 * Copyright (c) 2011-2018 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __VOICE_CONTROL_MANAGER_H__
19 #define __VOICE_CONTROL_MANAGER_H__
21 #include <voice_control_command.h>
22 #include <voice_control_common.h>
25 * @addtogroup CAPI_UIX_VOICE_CONTROL_MANAGER_MODULE
36 * @brief Definition of Bluetooth audio-in type.
39 #define VC_AUDIO_TYPE_BLUETOOTH "VC_AUDIO_ID_BLUETOOTH" /**< Bluetooth audio type */
42 * @brief Definition of Wi-Fi audio-in type.
45 #define VC_AUDIO_TYPE_WIFI "VC_AUDIO_ID_WIFI" /**< Wi-Fi audio type */
48 * @brief Definition for foreground command type.
51 #define VC_COMMAND_TYPE_FOREGROUND 1
54 * @brief Definition for background command type.
57 #define VC_COMMAND_TYPE_BACKGROUND 2
60 * @brief Definition for widget command type.
63 #define VC_COMMAND_TYPE_WIDGET 3
66 * @brief Definition for system command type.
69 #define VC_COMMAND_TYPE_SYSTEM 4
72 * @brief Definition for system background command type.
75 #define VC_COMMAND_TYPE_SYSTEM_BACKGROUND 5
78 * @brief Definition for exclusive command type.
81 #define VC_COMMAND_TYPE_EXCLUSIVE 6
84 * @brief Definition for none message.
87 #define VC_RESULT_MESSAGE_NONE "vc.result.message.none"
90 * @brief Definition for failed recognition because the speech is too loud to listen.
93 #define VC_RESULT_MESSAGE_ERROR_TOO_LOUD "vc.result.message.error.too.loud"
96 * @brief Enumeration of recognition mode.
100 VC_RECOGNITION_MODE_STOP_BY_SILENCE, /**< Default mode */
101 VC_RECOGNITION_MODE_RESTART_AFTER_REJECT, /**< Restart recognition after rejected result */
102 VC_RECOGNITION_MODE_RESTART_CONTINUOUSLY, /**< Continuously restart recognition - not support yet*/
103 VC_RECOGNITION_MODE_MANUAL /**< Start and stop manually without silence */
104 } vc_recognition_mode_e;
107 * @brief Enumeration of send event type.
111 VC_SEND_EVENT_TYPE_TEXT, /**< Send text event to VC engine */
112 VC_SEND_EVENT_TYPE_LIST_EVENT, /**< Send list event to VC engine */
113 VC_SEND_EVENT_TYPE_HAPTIC_EVENT /**< Send haptic event to VC engine */
114 } vc_send_event_type_e;
117 * @brief Enumeration of pre result event.
121 VC_PRE_RESULT_EVENT_FINAL_RESULT = 0, /**< Pre-result event for final result */
122 VC_PRE_RESULT_EVENT_PARTIAL_RESULT, /**< Pre-result event for partial result */
123 VC_PRE_RESULT_EVENT_ERROR /**< Pre-result event for error */
124 } vc_pre_result_event_e;
127 * @brief Called when client gets the all recognition results from voice control service.
130 * @remarks The @a vc_cmd_list should not be released. It is managed by the platform and will be released when invoking this callback is finished. \n
131 * The @a result and @a msg are also managed by the platform and will be released when invoking this callback is finished.
133 * @param[in] event The result event
134 * @param[in] vc_cmd_list Command list handle
135 * @param[in] result Command text
136 * @param[in] msg Engine message (e.g. #VC_RESULT_MESSAGE_NONE, #VC_RESULT_MESSAGE_ERROR_TOO_LOUD)
137 * @param[in] user_data The user data passed from the callback registration function
139 * @return @c true to release command to client, \n @c false to wait for selecting command.
140 * @pre An application registers callback function using vc_mgr_set_all_result_cb().
142 * @see vc_mgr_set_all_result_cb()
143 * @see vc_mgr_unset_all_result_cb()
145 typedef bool (*vc_mgr_all_result_cb)(vc_result_event_e event, vc_cmd_list_h vc_cmd_list,
146 const char *result, const char *msg, void *user_data);
149 * @brief Called when client gets the pre recognition results (partial ASR) from voice control service.
152 * @remarks The @a result is managed by the platform and will be released when invoking this callback is finished.
154 * @param[in] event The pre result event
155 * @param[in] result ASR text
156 * @param[in] user_data The user data passed from the callback registration function
158 * @pre An application registers callback function using vc_mgr_set_pre_result_cb().
160 * @see vc_mgr_set_pre_result_cb()
161 * @see vc_mgr_unset_pre_result_cb()
163 typedef void (*vc_mgr_pre_result_cb)(vc_pre_result_event_e event, const char *result, void *user_data);
166 * @brief Called when client gets the specific engine's result from vc-service.
169 * @param[in] engine_app_id The specific engine's app id
170 * @param[in] event The specific engine event type
171 * @param[in] result The specific engine result
172 * @param[in] user_data The user data passed from the callback registration function
174 * @pre An application registers callback function using vc_mgr_set_specific_engine_result_cb().
176 * @see vc_mgr_set_specific_engine_result_cb()
177 * @see vc_mgr_unset_specific_engine_result_cb()
179 typedef void (*vc_mgr_specific_engine_result_cb)(const char* engine_app_id, const char* event, const char* result, void *user_data);
182 * @brief Called when user speaking is detected.
185 * @param[in] user_data The user data passed from the callback registration function
187 * @pre An application registers callback function using vc_mgr_set_speech_detected_cb().
189 * @see vc_mgr_set_speech_detected_cb()
190 * @see vc_mgr_unset_speech_detected_cb()
192 typedef void (*vc_mgr_begin_speech_detected_cb)(void *user_data);
196 * @brief Called when an application (VC client) requests dialog.
199 * @remarks The @a disp_text and @a utt_text are managed by the platform and will be released when invoking this callback is finished.
201 * @param[in] pid Pid of VC client to request dialog
202 * @param[in] disp_text Text requested to be displayed
203 * @param[in] utt_text Text requested to be spoken
204 * @param[in] continuous Continue dialog session
205 * @param[in] user_data The user data passed from the callback registration function
207 * @pre An application registers callback function using vc_mgr_set_dialog_request_cb().
209 * @see vc_mgr_set_dialog_request_cb()
210 * @see vc_mgr_unset_dialog_request_cb()
212 typedef void (*vc_mgr_dialog_request_cb)(int pid, const char *disp_text, const char *utt_text, bool continuous, void *user_data);
215 * @brief Called when engine sets private data to manager client.
218 * @remarks The @a key and @a data are managed by the platform and will be released when invoking this callback is finished.
220 * @param[in] key Private key
221 * @param[in] data Private data
222 * @param[in] user_data The user data passed from the callback registration function
224 * @pre An application registers callback function using vc_mgr_set_private_data_set_cb().
226 * @see vc_mgr_set_private_data_set_cb()
227 * @see vc_mgr_unset_private_data_set_cb()
229 typedef int (*vc_mgr_private_data_set_cb)(const char *key, const char *data, void *user_data);
232 * @brief Called when engine requests private data from manager client.
235 * @remarks The @a data should not be released. The @a data and @a key are managed by the platform and will be released when invoking this callback is finished.
237 * @param[in] key Private key
238 * @param[out] data Private data
239 * @param[in] user_data The user data passed from the callback registration function
241 * @pre An application registers callback function using vc_mgr_set_private_data_requested_cb().
243 * @see vc_mgr_set_private_data_requested_cb()
244 * @see vc_mgr_unset_private_data_requested_cb()
246 typedef int (*vc_mgr_private_data_requested_cb)(const char *key, char **data, void *user_data);
248 /* for TTS feedback */
250 * @brief Called when engine sends audio formats necessary for playing TTS feedback
252 * @param[in] rate Audio sampling rate
253 * @param[in] channel Audio channel (e.g. #VC_AUDIO_CHANNEL_MONO, #VC_AUDIO_CHANNEL_STEREO)
254 * @param[in] audio_type Audio type (e.g. #VC_AUDIO_TYPE_PCM_S16_LE, #VC_AUDIO_TYPE_PCM_U8)
255 * @param[in] user_data The user data passed from the callback registration function
257 * @pre An application registers callback function using vc_mgr_set_feedback_audio_format_cb().
259 * @see vc_mgr_set_feedback_audio_format_cb()
260 * @see vc_mgr_unset_feedback_audio_format_cb()
262 typedef void (*vc_mgr_feedback_audio_format_cb)(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data);
265 * @brief Called when engine sends audio streaming for TTS feedback
267 * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
268 * @param[in] buffer Audio streaming data
269 * @param[in] len Length of the audio streaming data
270 * @param[in] user_data The user data passed from the callback registration function
272 * @pre An application registers callback function using vc_mgr_set_feedback_streaming_cb().
274 * @see vc_mgr_set_feedback_streaming_cb()
275 * @see vc_mgr_unset_feedback_streaming_cb()
277 typedef void (*vc_mgr_feedback_streaming_cb)(vc_feedback_event_e event, char* buffer, int len, void *user_data);
282 * @brief Initializes the voice control manager.
286 * @privilege %http://tizen.org/privilege/recorder
288 * @privlevel platform
289 * @privilege %http://tizen.org/privilege/voicecontrol.manager
291 * @remarks If the function succeeds, VC manager must be released with vc_mgr_deinitialize().
293 * @return 0 on success, otherwise a negative error value
294 * @retval #VC_ERROR_NONE Successful
295 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
296 * @retval #VC_ERROR_OPERATION_FAILED Operation fail
297 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
298 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
300 * @pre The state should be #VC_STATE_NONE.
301 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
303 * @see vc_mgr_deinitialize()
305 int vc_mgr_initialize(void);
309 * @brief Deinitializes the voice control manager.
312 * @privlevel platform
313 * @privilege %http://tizen.org/privilege/voicecontrol.manager
315 * @return 0 on success, otherwise a negative error value
316 * @retval #VC_ERROR_NONE Successful
317 * @retval #VC_ERROR_INVALID_STATE Invalid state
318 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
319 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
321 * @post If this function is called, the state will be #VC_STATE_NONE.
323 * @see vc_mgr_initialize()
325 int vc_mgr_deinitialize(void);
329 * @brief Connects the voice control service.
332 * @privlevel platform
333 * @privilege %http://tizen.org/privilege/voicecontrol.manager
335 * @return 0 on success, otherwise a negative error value
336 * @retval #VC_ERROR_NONE Successful
337 * @retval #VC_ERROR_INVALID_STATE Invalid state
338 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
339 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
341 * @pre The state should be #VC_STATE_INITIALIZED.
342 * @post If this function is called, the state will be #VC_STATE_READY.
344 * @see vc_mgr_unprepare()
346 int vc_mgr_prepare(void);
350 * @brief Disconnects the voice control service.
353 * @privlevel platform
354 * @privilege %http://tizen.org/privilege/voicecontrol.manager
356 * @return 0 on success, otherwise a negative error value
357 * @retval #VC_ERROR_NONE Successful
358 * @retval #VC_ERROR_INVALID_STATE Invalid state
359 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
360 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
362 * @pre The state should be #VC_STATE_READY.
363 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
365 * @see vc_mgr_prepare()
367 int vc_mgr_unprepare(void);
371 * @brief Retrieves all supported languages using callback function.
374 * @privlevel platform
375 * @privilege %http://tizen.org/privilege/voicecontrol.manager
377 * @param[in] callback Callback function to invoke
378 * @param[in] user_data The user data to be passed to the callback function
380 * @return 0 on success, otherwise a negative error value
381 * @retval #VC_ERROR_NONE Successful
382 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
383 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
384 * @retval #VC_ERROR_INVALID_STATE Invalid state
385 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
386 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
388 * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
389 * @post This function invokes vc_supported_language_cb() for each supported language.
391 * @see vc_supported_language_cb()
392 * @see vc_mgr_get_current_language()
394 int vc_mgr_foreach_supported_languages(vc_supported_language_cb callback, void *user_data);
398 * @brief Gets the current language set by user.
401 * @privlevel platform
402 * @privilege %http://tizen.org/privilege/voicecontrol.manager
404 * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it.
406 * @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n
407 * followed by ISO 639-1 for the two-letter language code. \n
408 * For example, "ko_KR" for Korean, "en_US" for American English.
410 * @return 0 on success, otherwise a negative error value
411 * @retval #VC_ERROR_NONE Successful
412 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
413 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
414 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
415 * @retval #VC_ERROR_INVALID_STATE Invalid state
416 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
417 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
419 * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
421 * @see vc_mgr_foreach_supported_languages()
423 int vc_mgr_get_current_language(char **language);
427 * @brief Gets the current state of voice control manager.
430 * @privlevel platform
431 * @privilege %http://tizen.org/privilege/voicecontrol.manager
433 * @param[out] state The current state
435 * @return 0 on success, otherwise a negative error value
436 * @retval #VC_ERROR_NONE Successful
437 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
438 * @retval #VC_ERROR_INVALID_STATE Invalid state
439 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
440 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
442 * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
444 * @see vc_state_changed_cb()
445 * @see vc_set_state_changed_cb()
447 int vc_mgr_get_state(vc_state_e *state);
451 * @brief Gets the current state of voice control service.
454 * @privlevel platform
455 * @privilege %http://tizen.org/privilege/voicecontrol.manager
457 * @param[out] state The current state
459 * @return 0 on success, otherwise a negative error value
460 * @retval #VC_ERROR_NONE Successful
461 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
462 * @retval #VC_ERROR_INVALID_STATE Invalid state
463 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
464 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
465 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
467 * @pre The state should be #VC_STATE_READY.
469 * @see vc_mgr_start()
471 * @see vc_mgr_cancel()
472 * @see vc_set_service_state_changed_cb()
473 * @see vc_unset_service_state_changed_cb()
475 int vc_mgr_get_service_state(vc_service_state_e *state);
479 * @brief Checks whether the command format is supported.
482 * @privlevel platform
483 * @privilege %http://tizen.org/privilege/voicecontrol.manager
485 * @remarks The command formats are defined in the #voice_control_command.h. (e.g. #VC_COMMAND_FORMAT_FIXED, #VC_COMMAND_FORMAT_FIXED_AND_NONFIXED, and so on). Please refer to #voice_control_command.h.
487 * @param[in] format The command format
488 * @param[out] support The result status @c true = supported, @c false = not supported
490 * @return 0 on success, otherwise a negative error value
491 * @retval #VC_ERROR_NONE Successful
492 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
493 * @retval #VC_ERROR_INVALID_STATE Invalid state
494 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
495 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
497 * @pre The state should be #VC_STATE_READY.
499 int vc_mgr_is_command_format_supported(int format, bool *support);
503 * @brief Sets all types of commands.
506 * @privlevel platform
507 * @privilege %http://tizen.org/privilege/voicecontrol.manager
509 * @remarks VC manager client can register all types of commands.
510 * The commands should include type, command text, format.
512 * @param[in] vc_cmd_list The command list handle
514 * @return 0 on success, otherwise a negative error value
515 * @retval #VC_ERROR_NONE Successful
516 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
517 * @retval #VC_ERROR_INVALID_STATE Invalid state
518 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
519 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
521 * @pre The state should be #VC_STATE_READY.
523 * @see vc_mgr_unset_command_list()
525 int vc_mgr_set_command_list(vc_cmd_list_h vc_cmd_list);
529 * @brief Unsets all types of commands.
532 * @privlevel platform
533 * @privilege %http://tizen.org/privilege/voicecontrol.manager
535 * @remarks All previously registered commands will be unset.
537 * @return 0 on success, otherwise a negative error value
538 * @retval #VC_ERROR_NONE Successful
539 * @retval #VC_ERROR_INVALID_STATE Invalid state
540 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
541 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
543 * @pre The state should be #VC_STATE_READY.
545 * @see vc_mgr_set_command_list()
547 int vc_mgr_unset_command_list(void);
551 * @brief Sets commands from file.
554 * @privlevel platform
555 * @privilege %http://tizen.org/privilege/voicecontrol.manager
557 * @remarks The commands should include type, command text, format.
559 * @param[in] file_path The directory of a file which has command list
560 * @param[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)
562 * @return 0 on success, otherwise a negative error value
563 * @retval #VC_ERROR_NONE Successful
564 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
565 * @retval #VC_ERROR_INVALID_STATE Invalid state
566 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
567 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
568 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
570 * @pre The state should be #VC_STATE_READY.
572 * @see vc_mgr_unset_command_list()
574 int vc_mgr_set_command_list_from_file(const char *file_path, int type);
578 * @brief Sets background commands of preloaded app from file.
581 * @privlevel platform
582 * @privilege %http://tizen.org/privilege/voicecontrol.manager
584 * @remarks The command type is valid for #VC_COMMAND_TYPE_BACKGROUND.
585 * The commands should include type, command text, format.
587 * @param[in] file_path The directory of a file which has command list
589 * @return 0 on success, otherwise a negative error value
590 * @retval #VC_ERROR_NONE Successful
591 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
592 * @retval #VC_ERROR_INVALID_STATE Invalid state
593 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
594 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
595 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
597 * @pre The state should be #VC_STATE_READY.
599 * @see vc_mgr_unset_command_list()
601 int vc_mgr_set_preloaded_commands_from_file(const char *file_path);
605 * @brief Retrieves all available commands.
608 * @privlevel platform
609 * @privilege %http://tizen.org/privilege/voicecontrol.manager
611 * @remarks If the function succeeds, @a vc_cmd_list must be released with vc_cmd_list_destroy(vc_cmd_list, true).
613 * @param[in] vc_cmd_list The command list
615 * @return 0 on success, otherwise a negative error value
616 * @retval #VC_ERROR_NONE Successful
617 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
618 * @retval #VC_ERROR_INVALID_STATE Invalid state
619 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
620 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
621 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
623 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
625 int vc_mgr_get_current_commands(vc_cmd_list_h *vc_cmd_list);
629 * @brief Sets a type of audio-in.
632 * @privlevel platform
633 * @privilege %http://tizen.org/privilege/voicecontrol.manager
635 * @param[in] audio_id The audio type (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
637 * @return 0 on success, otherwise a negative error value
638 * @retval #VC_ERROR_NONE Successful
639 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
640 * @retval #VC_ERROR_INVALID_STATE Invalid state
641 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
642 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
643 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
645 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
647 * @see vc_mgr_get_audio_type()
649 int vc_mgr_set_audio_type(const char *audio_id);
653 * @brief Gets a type of audio-in.
656 * @privlevel platform
657 * @privilege %http://tizen.org/privilege/voicecontrol.manager
659 * @remarks audio_id must be released using free() when it is no longer required.
661 * @param[out] audio_id The audio id (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
663 * @return 0 on success, otherwise a negative error value
664 * @retval #VC_ERROR_NONE Successful
665 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
666 * @retval #VC_ERROR_INVALID_STATE Invalid state
667 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
668 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
670 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
672 * @see vc_mgr_set_audio_type()
674 int vc_mgr_get_audio_type(char **audio_id);
678 * @brief Sets recognition mode.
681 * @privlevel platform
682 * @privilege %http://tizen.org/privilege/voicecontrol.manager
684 * @param[in] mode Recognition mode (e.g. #VC_RECOGNITION_MODE_STOP_BY_SILENCE is default value)
686 * @return 0 on success, otherwise a negative error value
687 * @retval #VC_ERROR_NONE Successful
688 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
689 * @retval #VC_ERROR_INVALID_STATE Invalid state
690 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
691 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
693 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
695 * @see vc_mgr_set_recognition_mode()
697 int vc_mgr_set_recognition_mode(vc_recognition_mode_e mode);
701 * @brief Gets recognition mode.
704 * @privlevel platform
705 * @privilege %http://tizen.org/privilege/voicecontrol.manager
707 * @param[out] mode Recognition mode
709 * @return 0 on success, otherwise a negative error value
710 * @retval #VC_ERROR_NONE Successful
711 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
712 * @retval #VC_ERROR_INVALID_STATE Invalid state
713 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
714 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
716 * @pre The state should be #VC_STATE_READY.
718 * @see vc_mgr_get_recognition_mode()
720 int vc_mgr_get_recognition_mode(vc_recognition_mode_e *mode);
724 * @brief Sets private data to VC engine.
727 * @privlevel platform
728 * @privilege %http://tizen.org/privilege/voicecontrol.manager
730 * @remarks VC manager client can set private data to VC engine using this function.
732 * @param[in] key Private key
733 * @param[in] data Private data
735 * @return 0 on success, otherwise a negative error value
736 * @retval #VC_ERROR_NONE Successful
737 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
738 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
739 * @retval #VC_ERROR_INVALID_STATE Invalid state
740 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
741 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
743 * @pre The service state should be #VC_SERVICE_STATE_READY.
745 int vc_mgr_set_private_data(const char *key, const char *data);
749 * @brief Gets private data from VC engine.
752 * @privlevel platform
753 * @privilege %http://tizen.org/privilege/voicecontrol.manager
755 * @remarks VC manager client can get private data from VC engine using this function.
756 * @a data must be released using free() when it is no longer required.
758 * @param[in] key Private key
759 * @param[out] data Private data
761 * @return 0 on success, otherwise a negative error value
762 * @retval #VC_ERROR_NONE Successful
763 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
764 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
765 * @retval #VC_ERROR_INVALID_STATE Invalid state
766 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
767 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
769 * @pre The service state should be #VC_SERVICE_STATE_READY.
771 int vc_mgr_get_private_data(const char *key, char **data);
775 * @brief Requests to do action as if utterance is spoken.
778 * @privlevel platform
779 * @privilege %http://tizen.org/privilege/voicecontrol.manager
781 * @param[in] type Event type
782 * @param[in] send_event The string for send event
784 * @return 0 on success, otherwise a negative error value
785 * @retval #VC_ERROR_NONE Successful
786 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
787 * @retval #VC_ERROR_INVALID_STATE Invalid state
788 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
789 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
790 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
792 * @pre The service state should be #VC_SERVICE_STATE_READY.
794 int vc_mgr_do_action(vc_send_event_type_e type, char *send_event);
797 * @brief Sends the specific engine request to the vc-service.
800 * @param[in] engine_app_id A specific engine's app id
801 * @param[in] event A engine service user request event
802 * @param[in] request A engine service user request text
804 * @return 0 on success, otherwise a negative error value
805 * @retval #VC_ERROR_NONE Successful
806 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
807 * @retval #VC_ERROR_INVALID_STATE Invalid state
808 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
809 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
811 int vc_mgr_send_specific_engine_request(const char* engine_app_id, const char* event, const char* request);
815 * @brief Starts recognition.
818 * @privlevel platform
819 * @privilege %http://tizen.org/privilege/voicecontrol.manager
821 * @remarks The default recognition mode is #VC_RECOGNITION_MODE_STOP_BY_SILENCE. \n
822 * If you want to use other mode, you can set mode with vc_mgr_set_recognition_mode().
824 * @param[in] exclusive_command_option Exclusive command option
826 * @return 0 on success, otherwise a negative error value
827 * @retval #VC_ERROR_NONE Successful
828 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter.
829 * @retval #VC_ERROR_INVALID_STATE Invalid state
830 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
831 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
832 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
833 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
835 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
836 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
837 * If this function succeeds, the service state will be #VC_SERVICE_STATE_RECORDING.
840 * @see vc_mgr_cancel()
841 * @see vc_service_state_changed_cb()
842 * @see vc_mgr_set_recognition_mode()
843 * @see vc_mgr_get_recognition_mode()
845 int vc_mgr_start(bool exclusive_command_option);
849 * @brief Stops recognition.
852 * @privlevel platform
853 * @privilege %http://tizen.org/privilege/voicecontrol.manager
855 * @return 0 on success, otherwise a negative error value
856 * @retval #VC_ERROR_NONE Successful
857 * @retval #VC_ERROR_INVALID_STATE Invalid state
858 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
859 * @retval #VC_ERROR_IN_PROGRESS_TO_READY In progress to ready
860 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
861 * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING In progress to processing
862 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
863 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
865 * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
866 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
867 * If this function succeeds, the service state will be #VC_SERVICE_STATE_PROCESSING.
869 * @see vc_mgr_start()
870 * @see vc_mgr_cancel()
871 * @see vc_service_state_changed_cb()
872 * @see vc_mgr_result_cb()
874 int vc_mgr_stop(void);
878 * @brief Cancels recognition.
881 * @privlevel platform
882 * @privilege %http://tizen.org/privilege/voicecontrol.manager
884 * @return 0 on success, otherwise a negative error value
885 * @retval #VC_ERROR_NONE Successful
886 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
887 * @retval #VC_ERROR_INVALID_STATE Invalid state
888 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
889 * @retval #VC_ERROR_IN_PROGRESS_TO_READY In progress to ready
890 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
891 * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING In progress to processing
892 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
893 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
895 * @pre The service state should be #VC_SERVICE_STATE_RECORDING or #VC_SERVICE_STATE_PROCESSING.
896 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
897 * If this function succeeds, the service state will be #VC_SERVICE_STATE_READY.
899 * @see vc_mgr_start()
901 * @see vc_service_state_changed_cb()
903 int vc_mgr_cancel(void);
907 * @brief Gets the microphone volume during recording.
910 * @privlevel platform
911 * @privilege %http://tizen.org/privilege/voicecontrol.manager
913 * @param[out] volume Recording volume
915 * @return 0 on success, otherwise a negative error value
916 * @retval #VC_ERROR_NONE Successful
917 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
918 * @retval #VC_ERROR_INVALID_STATE Invalid state
919 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
920 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
922 * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
924 * @see vc_mgr_start()
926 int vc_mgr_get_recording_volume(float *volume);
930 * @brief Selects valid results from all results.
933 * @privlevel platform
934 * @privilege %http://tizen.org/privilege/voicecontrol.manager
936 * @remarks This function should be called in vc_mgr_all_result_cb().
937 * The @a vc_cmd_list can be NULL, in that case the function does nothing.
938 * @param[in] vc_cmd_list The valid result list
940 * @return 0 on success, otherwise a negative error value
941 * @retval #VC_ERROR_NONE Successful
942 * @retval #VC_ERROR_INVALID_STATE Invalid state
943 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
944 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
946 * @pre vc_mgr_all_result_cb() should be called
948 * @see vc_mgr_all_result_cb()
950 int vc_mgr_set_selected_results(vc_cmd_list_h vc_cmd_list);
955 * @brief Sets a callback function for getting recognition result.
958 * @privlevel platform
959 * @privilege %http://tizen.org/privilege/voicecontrol.manager
961 * @param[in] callback Callback function to register
962 * @param[in] user_data The user data to be passed to the callback function
964 * @return 0 on success, otherwise a negative error value
965 * @retval #VC_ERROR_NONE Successful
966 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
967 * @retval #VC_ERROR_INVALID_STATE Invalid state
968 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
969 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
971 * @pre The state should be #VC_STATE_INITIALIZED.
973 * @see vc_mgr_all_result_cb()
974 * @see vc_mgr_unset_all_result_cb()
976 int vc_mgr_set_all_result_cb(vc_mgr_all_result_cb callback, void *user_data);
980 * @brief Unsets the recognition result callback function.
983 * @privlevel platform
984 * @privilege %http://tizen.org/privilege/voicecontrol.manager
986 * @return 0 on success, otherwise a negative error value
987 * @retval #VC_ERROR_NONE Successful
988 * @retval #VC_ERROR_INVALID_STATE Invalid state
989 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
990 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
992 * @pre The state should be #VC_STATE_INITIALIZED.
994 * @see vc_mgr_set_all_result_cb()
996 int vc_mgr_unset_all_result_cb(void);
1000 * @brief Sets a callback function for getting pre recognition result.
1003 * @privlevel platform
1004 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1006 * @param[in] callback Callback function to register
1007 * @param[in] user_data The user data to be passed to the callback function
1009 * @return 0 on success, otherwise a negative error value
1010 * @retval #VC_ERROR_NONE Successful
1011 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1012 * @retval #VC_ERROR_INVALID_STATE Invalid state
1013 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1014 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1016 * @pre The state should be #VC_STATE_INITIALIZED.
1018 * @see vc_mgr_pre_result_cb()
1019 * @see vc_mgr_unset_pre_result_cb()
1021 int vc_mgr_set_pre_result_cb(vc_mgr_pre_result_cb callback, void *user_data);
1025 * @brief Unsets the pre recognition result callback function.
1028 * @privlevel platform
1029 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1031 * @return 0 on success, otherwise a negative error value
1032 * @retval #VC_ERROR_NONE Successful
1033 * @retval #VC_ERROR_INVALID_STATE Invalid state
1034 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1035 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1037 * @pre The state should be #VC_STATE_INITIALIZED.
1039 * @see vc_mgr_set_pre_result_cb()
1041 int vc_mgr_unset_pre_result_cb(void);
1044 * @brief Registers a callback function for getting specific engine result.
1047 * @param[in] callback Callback function to register
1048 * @param[in] user_data The user data to be passed to the callback function
1050 * @return 0 on success, otherwise a negative error value
1051 * @retval #VC_ERROR_NONE Successful
1052 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1053 * @retval #VC_ERROR_INVALID_STATE Invalid state
1054 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1055 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1057 * @pre The state should be #VC_STATE_INITIALIZED.
1059 * @see vc_mgr_unset_specific_engine_result_cb()
1061 int vc_mgr_set_specific_engine_result_cb(vc_mgr_specific_engine_result_cb callback, void* user_data);
1064 * @brief Unregisters the specific engine result callback function.
1067 * @return 0 on success, otherwise a negative error value
1068 * @retval #VC_ERROR_NONE Successful
1069 * @retval #VC_ERROR_INVALID_STATE Invalid state
1070 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1071 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1073 * @pre The state should be #VC_STATE_INITIALIZED.
1075 * @see vc_mgr_set_specific_engine_result_cb()
1077 int vc_mgr_unset_specific_engine_result_cb(void);
1081 * @brief Sets a callback function for getting all types of recognition results.
1084 * @privlevel platform
1085 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1087 * @param[in] callback Callback function to register
1088 * @param[in] user_data The user data to be passed to the callback function
1090 * @return 0 on success, otherwise a negative error value
1091 * @retval #VC_ERROR_NONE Successful
1092 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1093 * @retval #VC_ERROR_INVALID_STATE Invalid state
1094 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1095 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1097 * @pre The state should be #VC_STATE_INITIALIZED.
1099 * @see vc_result_cb()
1100 * @see vc_mgr_unset_result_cb()
1102 int vc_mgr_set_result_cb(vc_result_cb callback, void *user_data);
1106 * @brief Unsets the callback function for getting all types of recognition results.
1109 * @privlevel platform
1110 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1112 * @return 0 on success, otherwise a negative error value
1113 * @retval #VC_ERROR_NONE Successful
1114 * @retval #VC_ERROR_INVALID_STATE Invalid state
1115 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1116 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1118 * @pre The state should be #VC_STATE_INITIALIZED.
1120 * @see vc_mgr_set_result_cb()
1122 int vc_mgr_unset_result_cb(void);
1126 * @brief Sets a callback function to be called when state is changed.
1129 * @privlevel platform
1130 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1132 * @param[in] callback Callback function to register
1133 * @param[in] user_data The user data to be passed to the callback function
1135 * @return 0 on success, otherwise a negative error value
1136 * @retval #VC_ERROR_NONE Successful
1137 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1138 * @retval #VC_ERROR_INVALID_STATE Invalid state
1139 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1140 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1142 * @pre The state should be #VC_STATE_INITIALIZED.
1144 * @see vc_state_changed_cb()
1145 * @see vc_mgr_unset_state_changed_cb()
1147 int vc_mgr_set_state_changed_cb(vc_state_changed_cb callback, void *user_data);
1151 * @brief Unsets the state changed callback function.
1154 * @privlevel platform
1155 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1157 * @return 0 on success, otherwise a negative error value
1158 * @retval #VC_ERROR_NONE Successful
1159 * @retval #VC_ERROR_INVALID_STATE Invalid state
1160 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1161 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1163 * @pre The state should be #VC_STATE_INITIALIZED.
1165 * @see vc_mgr_set_state_changed_cb()
1167 int vc_mgr_unset_state_changed_cb(void);
1171 * @brief Sets a callback function to be called when service state is changed.
1174 * @privlevel platform
1175 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1177 * @param[in] callback Callback function to register
1178 * @param[in] user_data The user data to be passed to the callback function
1180 * @return 0 on success, otherwise a negative error value
1181 * @retval #VC_ERROR_NONE Successful
1182 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1183 * @retval #VC_ERROR_INVALID_STATE Invalid state
1184 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1185 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1187 * @pre The state should be #VC_STATE_INITIALIZED.
1189 * @see vc_service_state_changed_cb()
1190 * @see vc_mgr_unset_service_state_changed_cb()
1192 int vc_mgr_set_service_state_changed_cb(vc_service_state_changed_cb callback, void *user_data);
1196 * @brief Unsets the service state changed callback function.
1199 * @privlevel platform
1200 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1202 * @return 0 on success, otherwise a negative error value
1203 * @retval #VC_ERROR_NONE Successful
1204 * @retval #VC_ERROR_INVALID_STATE Invalid state
1205 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1206 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1208 * @pre The state should be #VC_STATE_INITIALIZED.
1210 * @see vc_mgr_set_service_state_changed_cb()
1212 int vc_mgr_unset_service_state_changed_cb(void);
1216 * @brief Sets a callback function to be called when begin of speech is detected.
1219 * @privlevel platform
1220 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1222 * @param[in] callback Callback function to register
1223 * @param[in] user_data The user data to be passed to the callback function
1225 * @return 0 on success, otherwise a negative error value
1226 * @retval #VC_ERROR_NONE Successful
1227 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1228 * @retval #VC_ERROR_INVALID_STATE Invalid state
1229 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1230 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1232 * @pre The state should be #VC_STATE_INITIALIZED.
1234 * @see vc_mgr_begin_speech_detected_cb()
1235 * @see vc_mgr_unset_speech_detected_cb()
1237 int vc_mgr_set_speech_detected_cb(vc_mgr_begin_speech_detected_cb callback, void *user_data);
1241 * @brief Unsets the speech detected callback function.
1244 * @privlevel platform
1245 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1247 * @return 0 on success, otherwise a negative error value
1248 * @retval #VC_ERROR_NONE Successful
1249 * @retval #VC_ERROR_INVALID_STATE Invalid state
1250 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1251 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1253 * @pre The state should be #VC_STATE_INITIALIZED.
1255 * @see vc_mgr_set_speech_detected_cb()
1257 int vc_mgr_unset_speech_detected_cb(void);
1261 * @brief Sets a callback function to be called when current language is changed.
1264 * @privlevel platform
1265 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1267 * @param[in] callback Callback function to register
1268 * @param[in] user_data The user data to be passed to the callback function
1270 * @return 0 on success, otherwise a negative error value
1271 * @retval #VC_ERROR_NONE Successful
1272 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1273 * @retval #VC_ERROR_INVALID_STATE Invalid state
1274 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1275 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1277 * @pre The state should be #VC_STATE_INITIALIZED.
1279 * @see vc_current_language_changed_cb()
1280 * @see vc_mgr_unset_current_language_changed_cb()
1282 int vc_mgr_set_current_language_changed_cb(vc_current_language_changed_cb callback, void *user_data);
1286 * @brief Unsets the current language changed callback function.
1289 * @privlevel platform
1290 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1292 * @return 0 on success, otherwise a negative error value
1293 * @retval #VC_ERROR_NONE Successful
1294 * @retval #VC_ERROR_INVALID_STATE Invalid state
1295 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1296 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1298 * @pre The state should be #VC_STATE_INITIALIZED.
1300 * @see vc_mgr_set_current_language_changed_cb()
1302 int vc_mgr_unset_current_language_changed_cb(void);
1306 * @brief Gets the current error message.
1309 * @privlevel platform
1310 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1312 * @remarks This function should be called during as vc error callback. If not, the error as operation failure will be returned. \n
1313 * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
1315 * @param[out] err_msg The current error message
1317 * @return 0 on success, otherwise a negative error value
1318 * @retval #VC_ERROR_NONE Successful
1319 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1320 * @retval #VC_ERROR_INVALID_STATE Invalid state
1321 * @retval $VC_ERROR_OPERATION_FAILED Operation failure
1322 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
1323 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1324 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1326 * @see vc_error_cb()
1328 int vc_mgr_get_error_message(char **err_msg);
1332 * @brief Sets a callback function to be called when an error occurred.
1335 * @privlevel platform
1336 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1338 * @param[in] callback Callback function to register
1339 * @param[in] user_data The user data to be passed to the callback function
1341 * @return 0 on success, otherwise a negative error value
1342 * @retval #VC_ERROR_NONE Successful
1343 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @retval #VC_ERROR_INVALID_STATE Invalid state
1345 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1346 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1348 * @pre The state should be #VC_STATE_INITIALIZED.
1350 * @see vc_error_cb()
1351 * @see vc_mgr_unset_error_cb()
1353 int vc_mgr_set_error_cb(vc_error_cb callback, void *user_data);
1357 * @brief Unsets the callback function to be called when an error occurred.
1360 * @privlevel platform
1361 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1363 * @return 0 on success, otherwise a negative error value
1364 * @retval #VC_ERROR_NONE Successful
1365 * @retval #VC_ERROR_INVALID_STATE Invalid state
1366 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1367 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1369 * @pre The state should be #VC_STATE_INITIALIZED.
1371 * @see vc_mgr_set_error_cb()
1373 int vc_mgr_unset_error_cb(void);
1378 * @brief Sets a callback function to be called when dialog requests.
1381 * @privlevel platform
1382 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1384 * @param[in] callback Callback function to register
1385 * @param[in] user_data The user data to be passed to the callback function
1387 * @return 0 on success, otherwise a negative error value
1388 * @retval #VC_ERROR_NONE Successful
1389 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1390 * @retval #VC_ERROR_INVALID_STATE Invalid state
1391 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1392 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1394 * @pre The state should be #VC_STATE_INITIALIZED.
1396 * @see vc_mgr_unset_dialog_request_cb()
1398 int vc_mgr_set_dialog_request_cb(vc_mgr_dialog_request_cb callback, void *user_data);
1402 * @brief Unsets the callback function to be called when dialog requests.
1405 * @privlevel platform
1406 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1408 * @return 0 on success, otherwise a negative error value
1409 * @retval #VC_ERROR_NONE Successful
1410 * @retval #VC_ERROR_INVALID_STATE Invalid state
1411 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1412 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1414 * @pre The state should be #VC_STATE_INITIALIZED.
1416 * @see vc_mgr_set_dialog_request_cb()
1418 int vc_mgr_unset_dialog_request_cb(void);
1422 * @brief Enables command type as candidate command.
1425 * @privlevel platform
1426 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1428 * @param[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)
1430 * @return 0 on success, otherwise a negative error value
1431 * @retval #VC_ERROR_NONE Successful
1432 * @retval #VC_ERROR_INVALID_STATE Invalid state
1433 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1434 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1435 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1437 * @pre The state should be #VC_STATE_READY.
1439 * @see vc_mgr_disable_command_type()
1441 int vc_mgr_enable_command_type(int cmd_type);
1445 * @brief Disables command type as candidate command.
1448 * @privlevel platform
1449 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1451 * @param[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)
1453 * @return 0 on success, otherwise a negative error value
1454 * @retval #VC_ERROR_NONE Successful
1455 * @retval #VC_ERROR_INVALID_STATE Invalid state
1456 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1457 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1458 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1460 * @pre The state should be #VC_STATE_READY.
1462 * @see vc_mgr_enable_command_type()
1464 int vc_mgr_disable_command_type(int cmd_type);
1468 * @brief Sets a callback function to be called when engine set private data.
1471 * @privlevel platform
1472 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1474 * @param[in] callback Callback function to register
1475 * @param[in] user_data The user data to be passed to the callback function
1477 * @return 0 on success, otherwise a negative error value
1478 * @retval #VC_ERROR_NONE Successful
1479 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1480 * @retval #VC_ERROR_INVALID_STATE Invalid state
1481 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1482 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1484 * @pre The state should be #VC_STATE_INITIALIZED.
1486 * @see vc_private_data_set_cb()
1487 * @see vc_mgr_unset_private_data_set_cb()
1489 int vc_mgr_set_private_data_set_cb(vc_mgr_private_data_set_cb callback, void *user_data);
1493 * @brief Unsets the callback function to be called when engine set private data.
1496 * @privlevel platform
1497 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1499 * @return 0 on success, otherwise a negative error value
1500 * @retval #VC_ERROR_NONE Successful
1501 * @retval #VC_ERROR_INVALID_STATE Invalid state
1502 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1503 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1505 * @pre The state should be #VC_STATE_INITIALIZED.
1507 * @see vc_mgr_set_private_data_set_cb()
1509 int vc_mgr_unset_private_data_set_cb(void);
1513 * @brief Sets a callback function to be called when engine request private data.
1516 * @privlevel platform
1517 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1519 * @param[in] callback Callback function to register
1520 * @param[in] user_data The user data to be passed to the callback function
1522 * @return 0 on success, otherwise a negative error value
1523 * @retval #VC_ERROR_NONE Successful
1524 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1525 * @retval #VC_ERROR_INVALID_STATE Invalid state
1526 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1527 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1529 * @pre The state should be #VC_STATE_INITIALIZED.
1531 * @see vc_private_data_requested_cb()
1532 * @see vc_mgr_unset_private_data_requested_cb()
1534 int vc_mgr_set_private_data_requested_cb(vc_mgr_private_data_requested_cb callback, void *user_data);
1538 * @brief Unsets the callback function to be called when engine request private data.
1541 * @privlevel platform
1542 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1544 * @return 0 on success, otherwise a negative error value
1545 * @retval #VC_ERROR_NONE Successful
1546 * @retval #VC_ERROR_INVALID_STATE Invalid state
1547 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1548 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1550 * @pre The state should be #VC_STATE_INITIALIZED.
1552 * @see vc_mgr_set_private_data_requested_cb()
1554 int vc_mgr_unset_private_data_requested_cb(void);
1556 /* for TTS feedback */
1558 * @brief Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1560 * @param[in] callback Callback function to set
1561 * @param[in] user_data The user data to be passed to the callback function
1563 * @return 0 on success, otherwise a negative error value
1564 * @retval #VC_ERROR_NONE Successful
1565 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1566 * @retval #VC_ERROR_INVALID_STATE Invalid state
1568 * @pre The state should be #VC_STATE_INITIALIZED.
1570 * @see vc_mgr_feedback_audio_format_cb()
1571 * @see vc_mgr_unset_feedback_audio_format_cb()
1573 int vc_mgr_set_feedback_audio_format_cb(vc_mgr_feedback_audio_format_cb callback, void* user_data);
1576 * @brief Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1578 * @return 0 on success, otherwise a negative error value
1579 * @retval #VC_ERROR_NONE Successful
1580 * @retval #VC_ERROR_INVALID_STATE Invalid state
1582 * @pre The state should be #VC_STATE_INITIALIZED.
1584 * @see vc_mgr_feedback_audio_format_cb()
1585 * @see vc_mgr_set_feedback_audio_format_cb()
1587 int vc_mgr_unset_feedback_audio_format_cb(void);
1590 * @brief Sets a callback function to be called when engine sends audio streaming for TTS feedback.
1592 * @param[in] callback Callback function to set
1593 * @param[in] user_data The user data to be passed to the callback function
1595 * @return 0 on success, otherwise a negative error value
1596 * @retval #VC_ERROR_NONE Successful
1597 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1598 * @retval #VC_ERROR_INVALID_STATE Invalid state
1600 * @pre The state should be #VC_STATE_INITIALIZED.
1602 * @see vc_mgr_feedback_streaming_cb()
1603 * @see vc_mgr_unset_feedback_streaming_cb()
1605 int vc_mgr_set_feedback_streaming_cb(vc_mgr_feedback_streaming_cb callback, void* user_data);
1608 * @brief Unsets a callback function to be called when engine sends audio streaming for TTS feedback.
1610 * @return 0 on success, otherwise a negative error value
1611 * @retval #VC_ERROR_NONE Successful
1612 * @retval #VC_ERROR_INVALID_STATE Invalid state
1614 * @pre The state should be #VC_STATE_INITIALIZED.
1616 * @see vc_mgr_feedback_streaming_cb()
1617 * @see vc_mgr_set_feedback_streaming_cb()
1619 int vc_mgr_unset_feedback_streaming_cb(void);
1622 * @brief Starts getting TTS feedback streaming data from the buffer.
1624 * @remarks In order to get TTS feedback streaming data, the application should set 'vc_mgr_feedback_streaming_cb()' using vc_mgr_set_feedback_streaming_cb().
1626 * @return 0 on success, otherwise a negative error value
1627 * @retval #VC_ERROR_NONE Successful
1628 * @retval #VC_ERROR_INVALID_STATE Invalid state
1630 * @pre The state should be #VC_STATE_READY. \n
1631 * 'vc_mgr_feedback_streaming_cb()' should be registered.
1633 * @see vc_mgr_feedback_streaming_cb()
1634 * @see vc_mgr_set_feedback_streaming_cb()
1635 * @see vc_mgr_unset_feedback_streaming_cb()
1636 * @see vc_mgr_stop_feedback()
1638 int vc_mgr_start_feedback(void);
1641 * @brief Stops getting and removes TTS feedback streaming data from the buffer.
1643 * @return 0 on success, otherwise a negative error value
1644 * @retval #VC_ERROR_NONE Successful
1645 * @retval #VC_ERROR_INVALID_STATE Invalid state
1647 * @pre The state should be #VC_STATE_READY.
1649 * @see vc_mgr_feedback_streaming_cb()
1650 * @see vc_mgr_set_feedback_streaming_cb()
1651 * @see vc_mgr_unset_feedback_streaming_cb()
1652 * @see vc_mgr_start_feedback()
1654 int vc_mgr_stop_feedback(void);
1665 #endif /* __VOICE_CONTROL_MANAGER_H__ */