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
253 * @param[in] rate Audio sampling rate
254 * @param[in] channel Audio channel (e.g. #VC_AUDIO_CHANNEL_MONO, #VC_AUDIO_CHANNEL_STEREO)
255 * @param[in] audio_type Audio type (e.g. #VC_AUDIO_TYPE_PCM_S16_LE, #VC_AUDIO_TYPE_PCM_U8)
256 * @param[in] user_data The user data passed from the callback registration function
258 * @pre An application registers callback function using vc_mgr_set_feedback_audio_format_cb().
260 * @see vc_mgr_set_feedback_audio_format_cb()
261 * @see vc_mgr_unset_feedback_audio_format_cb()
263 typedef void (*vc_mgr_feedback_audio_format_cb)(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data);
266 * @brief Called when engine sends audio streaming for TTS feedback
269 * @remarks The @a buffer must be released with free() by you when you no longer need it.
271 * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
272 * @param[in] buffer Audio streaming data
273 * @param[in] len Length of the audio streaming data
274 * @param[in] user_data The user data passed from the callback registration function
276 * @pre An application registers callback function using vc_mgr_set_feedback_streaming_cb().
278 * @see vc_mgr_set_feedback_streaming_cb()
279 * @see vc_mgr_unset_feedback_streaming_cb()
281 typedef void (*vc_mgr_feedback_streaming_cb)(vc_feedback_event_e event, char* buffer, int len, void *user_data);
284 * @brief Called when the vc client sends audio streaming for TTS feedback
287 * @remarks The @a buffer must be released with free() by you when you no longer need it.
289 * @param[in] pid The process id of the vc client
290 * @param[in] utt_id The utterance id
291 * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
292 * @param[in] buffer Audio streaming data
293 * @param[in] len Length of the audio streaming data
294 * @param[in] user_data The user data passed from the callback registration function
296 * @pre An application registers callback function using vc_mgr_set_vc_tts_streaming_cb().
298 * @see vc_mgr_set_vc_tts_streaming_cb()
299 * @see vc_mgr_unset_vc_tts_streaming_cb()
301 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);
305 * @brief Initializes the voice control manager.
309 * @privilege %http://tizen.org/privilege/recorder
311 * @privlevel platform
312 * @privilege %http://tizen.org/privilege/voicecontrol.manager
314 * @remarks If the function succeeds, VC manager must be released with vc_mgr_deinitialize().
316 * @return 0 on success, otherwise a negative error value
317 * @retval #VC_ERROR_NONE Successful
318 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
319 * @retval #VC_ERROR_OPERATION_FAILED Operation fail
320 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
321 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
323 * @pre The state should be #VC_STATE_NONE.
324 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
326 * @see vc_mgr_deinitialize()
328 int vc_mgr_initialize(void);
332 * @brief Deinitializes the voice control manager.
335 * @privlevel platform
336 * @privilege %http://tizen.org/privilege/voicecontrol.manager
338 * @return 0 on success, otherwise a negative error value
339 * @retval #VC_ERROR_NONE Successful
340 * @retval #VC_ERROR_INVALID_STATE Invalid state
341 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
342 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
344 * @post If this function is called, the state will be #VC_STATE_NONE.
346 * @see vc_mgr_initialize()
348 int vc_mgr_deinitialize(void);
352 * @brief Connects the voice control service.
355 * @privlevel platform
356 * @privilege %http://tizen.org/privilege/voicecontrol.manager
358 * @return 0 on success, otherwise a negative error value
359 * @retval #VC_ERROR_NONE Successful
360 * @retval #VC_ERROR_INVALID_STATE Invalid state
361 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
362 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
364 * @pre The state should be #VC_STATE_INITIALIZED.
365 * @post If this function is called, the state will be #VC_STATE_READY.
367 * @see vc_mgr_unprepare()
369 int vc_mgr_prepare(void);
373 * @brief Disconnects the voice control service.
376 * @privlevel platform
377 * @privilege %http://tizen.org/privilege/voicecontrol.manager
379 * @return 0 on success, otherwise a negative error value
380 * @retval #VC_ERROR_NONE Successful
381 * @retval #VC_ERROR_INVALID_STATE Invalid state
382 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
383 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
385 * @pre The state should be #VC_STATE_READY.
386 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
388 * @see vc_mgr_prepare()
390 int vc_mgr_unprepare(void);
394 * @brief Retrieves all supported languages using callback function.
397 * @privlevel platform
398 * @privilege %http://tizen.org/privilege/voicecontrol.manager
400 * @param[in] callback Callback function to invoke
401 * @param[in] user_data The user data to be passed to the callback function
403 * @return 0 on success, otherwise a negative error value
404 * @retval #VC_ERROR_NONE Successful
405 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
406 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
407 * @retval #VC_ERROR_INVALID_STATE Invalid state
408 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
409 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
411 * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
412 * @post This function invokes vc_supported_language_cb() for each supported language.
414 * @see vc_supported_language_cb()
415 * @see vc_mgr_get_current_language()
417 int vc_mgr_foreach_supported_languages(vc_supported_language_cb callback, void *user_data);
421 * @brief Gets the current language set by user.
424 * @privlevel platform
425 * @privilege %http://tizen.org/privilege/voicecontrol.manager
427 * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it.
429 * @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n
430 * followed by ISO 639-1 for the two-letter language code. \n
431 * For example, "ko_KR" for Korean, "en_US" for American English.
433 * @return 0 on success, otherwise a negative error value
434 * @retval #VC_ERROR_NONE Successful
435 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
436 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
437 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
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_mgr_foreach_supported_languages()
446 int vc_mgr_get_current_language(char **language);
450 * @brief Gets the current state of voice control manager.
453 * @privlevel platform
454 * @privilege %http://tizen.org/privilege/voicecontrol.manager
456 * @param[out] state The current state
458 * @return 0 on success, otherwise a negative error value
459 * @retval #VC_ERROR_NONE Successful
460 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
461 * @retval #VC_ERROR_INVALID_STATE Invalid state
462 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
463 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
465 * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
467 * @see vc_state_changed_cb()
468 * @see vc_set_state_changed_cb()
470 int vc_mgr_get_state(vc_state_e *state);
474 * @brief Gets the current state of voice control service.
477 * @privlevel platform
478 * @privilege %http://tizen.org/privilege/voicecontrol.manager
480 * @param[out] state The current state
482 * @return 0 on success, otherwise a negative error value
483 * @retval #VC_ERROR_NONE Successful
484 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
485 * @retval #VC_ERROR_INVALID_STATE Invalid state
486 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
487 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
488 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
490 * @pre The state should be #VC_STATE_READY.
492 * @see vc_mgr_start()
494 * @see vc_mgr_cancel()
495 * @see vc_set_service_state_changed_cb()
496 * @see vc_unset_service_state_changed_cb()
498 int vc_mgr_get_service_state(vc_service_state_e *state);
502 * @brief Checks whether the command format is supported.
505 * @privlevel platform
506 * @privilege %http://tizen.org/privilege/voicecontrol.manager
508 * @remarks The command formats are defined in @ref CAPI_UIX_VOICE_CONTROL_COMMAND_MODULE. (e.g. #VC_COMMAND_FORMAT_FIXED, #VC_COMMAND_FORMAT_FIXED_AND_NONFIXED, and so on). Please refer to @ref CAPI_UIX_VOICE_CONTROL_COMMAND_MODULE.
510 * @param[in] format The command format
511 * @param[out] support The result status @c true = supported, @c false = not supported
513 * @return 0 on success, otherwise a negative error value
514 * @retval #VC_ERROR_NONE Successful
515 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
516 * @retval #VC_ERROR_INVALID_STATE Invalid state
517 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
518 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
520 * @pre The state should be #VC_STATE_READY.
522 int vc_mgr_is_command_format_supported(int format, bool *support);
526 * @brief Sets all types of commands.
529 * @privlevel platform
530 * @privilege %http://tizen.org/privilege/voicecontrol.manager
532 * @remarks VC manager client can register all types of commands.
533 * The commands should include type, command text, format.
535 * @param[in] vc_cmd_list The command list handle
537 * @return 0 on success, otherwise a negative error value
538 * @retval #VC_ERROR_NONE Successful
539 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
540 * @retval #VC_ERROR_INVALID_STATE Invalid state
541 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
542 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
544 * @pre The state should be #VC_STATE_READY.
546 * @see vc_mgr_unset_command_list()
548 int vc_mgr_set_command_list(vc_cmd_list_h vc_cmd_list);
552 * @brief Unsets all types of commands.
555 * @privlevel platform
556 * @privilege %http://tizen.org/privilege/voicecontrol.manager
558 * @remarks All previously registered commands will be unset.
560 * @return 0 on success, otherwise a negative error value
561 * @retval #VC_ERROR_NONE Successful
562 * @retval #VC_ERROR_INVALID_STATE Invalid state
563 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
564 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
566 * @pre The state should be #VC_STATE_READY.
568 * @see vc_mgr_set_command_list()
570 int vc_mgr_unset_command_list(void);
574 * @brief Sets commands from file.
577 * @privlevel platform
578 * @privilege %http://tizen.org/privilege/voicecontrol.manager
580 * @remarks The commands should include type, command text, format.
582 * @param[in] file_path The directory of a file which has command list
583 * @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)
585 * @return 0 on success, otherwise a negative error value
586 * @retval #VC_ERROR_NONE Successful
587 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
588 * @retval #VC_ERROR_INVALID_STATE Invalid state
589 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
590 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
591 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
593 * @pre The state should be #VC_STATE_READY.
595 * @see vc_mgr_unset_command_list()
597 int vc_mgr_set_command_list_from_file(const char *file_path, int type);
601 * @brief Sets background commands of preloaded app from file.
604 * @privlevel platform
605 * @privilege %http://tizen.org/privilege/voicecontrol.manager
607 * @remarks The command type is valid for #VC_COMMAND_TYPE_BACKGROUND.
608 * The commands should include type, command text, format.
610 * @param[in] file_path The directory of a file which has command list
612 * @return 0 on success, otherwise a negative error value
613 * @retval #VC_ERROR_NONE Successful
614 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
615 * @retval #VC_ERROR_INVALID_STATE Invalid state
616 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
617 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
618 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
620 * @pre The state should be #VC_STATE_READY.
622 * @see vc_mgr_unset_command_list()
624 int vc_mgr_set_preloaded_commands_from_file(const char *file_path);
628 * @brief Retrieves all available commands.
631 * @privlevel platform
632 * @privilege %http://tizen.org/privilege/voicecontrol.manager
634 * @remarks If the function succeeds, @a vc_cmd_list must be released with vc_cmd_list_destroy(vc_cmd_list, true).
636 * @param[in] vc_cmd_list The command list
638 * @return 0 on success, otherwise a negative error value
639 * @retval #VC_ERROR_NONE Successful
640 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
641 * @retval #VC_ERROR_INVALID_STATE Invalid state
642 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
643 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
644 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
646 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
648 int vc_mgr_get_current_commands(vc_cmd_list_h *vc_cmd_list);
652 * @brief Sets a type of audio-in.
655 * @privlevel platform
656 * @privilege %http://tizen.org/privilege/voicecontrol.manager
658 * @param[in] audio_id The audio type (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
660 * @return 0 on success, otherwise a negative error value
661 * @retval #VC_ERROR_NONE Successful
662 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
663 * @retval #VC_ERROR_INVALID_STATE Invalid state
664 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
665 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
666 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
668 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
670 * @see vc_mgr_get_audio_type()
672 int vc_mgr_set_audio_type(const char *audio_id);
676 * @brief Gets a type of audio-in.
679 * @privlevel platform
680 * @privilege %http://tizen.org/privilege/voicecontrol.manager
682 * @remarks audio_id must be released using free() when it is no longer required.
684 * @param[out] audio_id The audio id (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
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_audio_type()
697 int vc_mgr_get_audio_type(char **audio_id);
701 * @brief Sets recognition mode.
704 * @privlevel platform
705 * @privilege %http://tizen.org/privilege/voicecontrol.manager
707 * @param[in] mode Recognition mode (e.g. #VC_RECOGNITION_MODE_STOP_BY_SILENCE is default value)
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 and the service state should be #VC_SERVICE_STATE_READY.
718 * @see vc_mgr_set_recognition_mode()
720 int vc_mgr_set_recognition_mode(vc_recognition_mode_e mode);
724 * @brief Gets recognition mode.
727 * @privlevel platform
728 * @privilege %http://tizen.org/privilege/voicecontrol.manager
730 * @param[out] mode Recognition mode
732 * @return 0 on success, otherwise a negative error value
733 * @retval #VC_ERROR_NONE Successful
734 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
735 * @retval #VC_ERROR_INVALID_STATE Invalid state
736 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
737 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
739 * @pre The state should be #VC_STATE_READY.
741 * @see vc_mgr_get_recognition_mode()
743 int vc_mgr_get_recognition_mode(vc_recognition_mode_e *mode);
747 * @brief Sets private data to VC engine.
750 * @privlevel platform
751 * @privilege %http://tizen.org/privilege/voicecontrol.manager
753 * @remarks VC manager client can set private data to VC engine using this function.
755 * @param[in] key Private key
756 * @param[in] data Private data
758 * @return 0 on success, otherwise a negative error value
759 * @retval #VC_ERROR_NONE Successful
760 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
761 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
762 * @retval #VC_ERROR_INVALID_STATE Invalid state
763 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
764 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
766 * @pre The service state should be #VC_SERVICE_STATE_READY.
768 int vc_mgr_set_private_data(const char *key, const char *data);
772 * @brief Gets private data from VC engine.
775 * @privlevel platform
776 * @privilege %http://tizen.org/privilege/voicecontrol.manager
778 * @remarks VC manager client can get private data from VC engine using this function.
779 * @a data must be released using free() when it is no longer required.
781 * @param[in] key Private key
782 * @param[out] data Private data
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_PARAMETER Invalid parameter
788 * @retval #VC_ERROR_INVALID_STATE Invalid state
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_get_private_data(const char *key, char **data);
798 * @brief Requests to do action as if utterance is spoken.
801 * @privlevel platform
802 * @privilege %http://tizen.org/privilege/voicecontrol.manager
804 * @param[in] type Event type
805 * @param[in] send_event The string for send event
807 * @return 0 on success, otherwise a negative error value
808 * @retval #VC_ERROR_NONE Successful
809 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
810 * @retval #VC_ERROR_INVALID_STATE Invalid state
811 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
812 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
813 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
815 * @pre The service state should be #VC_SERVICE_STATE_READY.
817 int vc_mgr_do_action(vc_send_event_type_e type, char *send_event);
821 * @brief Sends the specific engine request to the vc-service.
824 * @privlevel platform
825 * @privilege %http://tizen.org/privilege/voicecontrol.manager
827 * @param[in] engine_app_id A specific engine's app id
828 * @param[in] event A engine service user request event
829 * @param[in] request A engine service user request text
831 * @return 0 on success, otherwise a negative error value
832 * @retval #VC_ERROR_NONE Successful
833 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
834 * @retval #VC_ERROR_INVALID_STATE Invalid state
835 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
836 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
837 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
838 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
840 int vc_mgr_send_specific_engine_request(const char* engine_app_id, const char* event, const char* request);
844 * @brief Starts recognition.
847 * @privlevel platform
848 * @privilege %http://tizen.org/privilege/voicecontrol.manager
850 * @remarks The default recognition mode is #VC_RECOGNITION_MODE_STOP_BY_SILENCE. \n
851 * If you want to use other mode, you can set mode with vc_mgr_set_recognition_mode().
853 * @param[in] exclusive_command_option Exclusive command option
855 * @return 0 on success, otherwise a negative error value
856 * @retval #VC_ERROR_NONE Successful
857 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter.
858 * @retval #VC_ERROR_INVALID_STATE Invalid state
859 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
860 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
861 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
862 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
864 * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
865 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
866 * If this function succeeds, the service state will be #VC_SERVICE_STATE_RECORDING.
869 * @see vc_mgr_cancel()
870 * @see vc_service_state_changed_cb()
871 * @see vc_mgr_set_recognition_mode()
872 * @see vc_mgr_get_recognition_mode()
874 int vc_mgr_start(bool exclusive_command_option);
878 * @brief Stops 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_INVALID_STATE Invalid state
887 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
888 * @retval #VC_ERROR_IN_PROGRESS_TO_READY In progress to ready
889 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
890 * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING In progress to processing
891 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
892 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
894 * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
895 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
896 * If this function succeeds, the service state will be #VC_SERVICE_STATE_PROCESSING.
898 * @see vc_mgr_start()
899 * @see vc_mgr_cancel()
900 * @see vc_service_state_changed_cb()
901 * @see vc_mgr_result_cb()
903 int vc_mgr_stop(void);
907 * @brief Cancels recognition.
910 * @privlevel platform
911 * @privilege %http://tizen.org/privilege/voicecontrol.manager
913 * @return 0 on success, otherwise a negative error value
914 * @retval #VC_ERROR_NONE Successful
915 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
916 * @retval #VC_ERROR_INVALID_STATE Invalid state
917 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
918 * @retval #VC_ERROR_IN_PROGRESS_TO_READY In progress to ready
919 * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING In progress to recording
920 * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING In progress to processing
921 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
922 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
924 * @pre The service state should be #VC_SERVICE_STATE_RECORDING or #VC_SERVICE_STATE_PROCESSING.
925 * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
926 * If this function succeeds, the service state will be #VC_SERVICE_STATE_READY.
928 * @see vc_mgr_start()
930 * @see vc_service_state_changed_cb()
932 int vc_mgr_cancel(void);
936 * @brief Gets the microphone volume during recording.
939 * @privlevel platform
940 * @privilege %http://tizen.org/privilege/voicecontrol.manager
942 * @param[out] volume Recording volume
944 * @return 0 on success, otherwise a negative error value
945 * @retval #VC_ERROR_NONE Successful
946 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
947 * @retval #VC_ERROR_INVALID_STATE Invalid state
948 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
949 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
951 * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
953 * @see vc_mgr_start()
955 int vc_mgr_get_recording_volume(float *volume);
959 * @brief Selects valid results from all results.
962 * @privlevel platform
963 * @privilege %http://tizen.org/privilege/voicecontrol.manager
965 * @remarks This function should be called in vc_mgr_all_result_cb().
966 * The @a vc_cmd_list can be NULL, in that case the function does nothing.
967 * @param[in] vc_cmd_list The valid result list
969 * @return 0 on success, otherwise a negative error value
970 * @retval #VC_ERROR_NONE Successful
971 * @retval #VC_ERROR_INVALID_STATE Invalid state
972 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
973 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
975 * @pre vc_mgr_all_result_cb() should be called
977 * @see vc_mgr_all_result_cb()
979 int vc_mgr_set_selected_results(vc_cmd_list_h vc_cmd_list);
984 * @brief Sets a callback function for getting recognition result.
987 * @privlevel platform
988 * @privilege %http://tizen.org/privilege/voicecontrol.manager
990 * @param[in] callback Callback function to register
991 * @param[in] user_data The user data to be passed to the callback function
993 * @return 0 on success, otherwise a negative error value
994 * @retval #VC_ERROR_NONE Successful
995 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
996 * @retval #VC_ERROR_INVALID_STATE Invalid state
997 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
998 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1000 * @pre The state should be #VC_STATE_INITIALIZED.
1002 * @see vc_mgr_all_result_cb()
1003 * @see vc_mgr_unset_all_result_cb()
1005 int vc_mgr_set_all_result_cb(vc_mgr_all_result_cb callback, void *user_data);
1009 * @brief Unsets the recognition result callback function.
1012 * @privlevel platform
1013 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1015 * @return 0 on success, otherwise a negative error value
1016 * @retval #VC_ERROR_NONE Successful
1017 * @retval #VC_ERROR_INVALID_STATE Invalid state
1018 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1019 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1021 * @pre The state should be #VC_STATE_INITIALIZED.
1023 * @see vc_mgr_set_all_result_cb()
1025 int vc_mgr_unset_all_result_cb(void);
1029 * @brief Sets a callback function for getting pre recognition result.
1032 * @privlevel platform
1033 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1035 * @param[in] callback Callback function to register
1036 * @param[in] user_data The user data to be passed to the callback function
1038 * @return 0 on success, otherwise a negative error value
1039 * @retval #VC_ERROR_NONE Successful
1040 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1041 * @retval #VC_ERROR_INVALID_STATE Invalid state
1042 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1043 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1045 * @pre The state should be #VC_STATE_INITIALIZED.
1047 * @see vc_mgr_pre_result_cb()
1048 * @see vc_mgr_unset_pre_result_cb()
1050 int vc_mgr_set_pre_result_cb(vc_mgr_pre_result_cb callback, void *user_data);
1054 * @brief Unsets the pre recognition result callback function.
1057 * @privlevel platform
1058 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1060 * @return 0 on success, otherwise a negative error value
1061 * @retval #VC_ERROR_NONE Successful
1062 * @retval #VC_ERROR_INVALID_STATE Invalid state
1063 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1064 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1066 * @pre The state should be #VC_STATE_INITIALIZED.
1068 * @see vc_mgr_set_pre_result_cb()
1070 int vc_mgr_unset_pre_result_cb(void);
1073 * @brief Registers a callback function for getting specific engine result.
1076 * @param[in] callback Callback function to register
1077 * @param[in] user_data The user data to be passed to the callback function
1079 * @return 0 on success, otherwise a negative error value
1080 * @retval #VC_ERROR_NONE Successful
1081 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1082 * @retval #VC_ERROR_INVALID_STATE Invalid state
1083 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1084 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1086 * @pre The state should be #VC_STATE_INITIALIZED.
1088 * @see vc_mgr_unset_specific_engine_result_cb()
1090 int vc_mgr_set_specific_engine_result_cb(vc_mgr_specific_engine_result_cb callback, void* user_data);
1093 * @brief Unregisters the specific engine result callback function.
1096 * @return 0 on success, otherwise a negative error value
1097 * @retval #VC_ERROR_NONE Successful
1098 * @retval #VC_ERROR_INVALID_STATE Invalid state
1099 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1100 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1102 * @pre The state should be #VC_STATE_INITIALIZED.
1104 * @see vc_mgr_set_specific_engine_result_cb()
1106 int vc_mgr_unset_specific_engine_result_cb(void);
1110 * @brief Sets a callback function for getting all types of recognition results.
1113 * @privlevel platform
1114 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1116 * @param[in] callback Callback function to register
1117 * @param[in] user_data The user data to be passed to the callback function
1119 * @return 0 on success, otherwise a negative error value
1120 * @retval #VC_ERROR_NONE Successful
1121 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1122 * @retval #VC_ERROR_INVALID_STATE Invalid state
1123 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1124 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1126 * @pre The state should be #VC_STATE_INITIALIZED.
1128 * @see vc_result_cb()
1129 * @see vc_mgr_unset_result_cb()
1131 int vc_mgr_set_result_cb(vc_result_cb callback, void *user_data);
1135 * @brief Unsets the callback function for getting all types of recognition results.
1138 * @privlevel platform
1139 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1141 * @return 0 on success, otherwise a negative error value
1142 * @retval #VC_ERROR_NONE Successful
1143 * @retval #VC_ERROR_INVALID_STATE Invalid state
1144 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1145 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1147 * @pre The state should be #VC_STATE_INITIALIZED.
1149 * @see vc_mgr_set_result_cb()
1151 int vc_mgr_unset_result_cb(void);
1155 * @brief Sets a callback function to be called when state is changed.
1158 * @privlevel platform
1159 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1161 * @param[in] callback Callback function to register
1162 * @param[in] user_data The user data to be passed to the callback function
1164 * @return 0 on success, otherwise a negative error value
1165 * @retval #VC_ERROR_NONE Successful
1166 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1167 * @retval #VC_ERROR_INVALID_STATE Invalid state
1168 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1169 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1171 * @pre The state should be #VC_STATE_INITIALIZED.
1173 * @see vc_state_changed_cb()
1174 * @see vc_mgr_unset_state_changed_cb()
1176 int vc_mgr_set_state_changed_cb(vc_state_changed_cb callback, void *user_data);
1180 * @brief Unsets the state changed callback function.
1183 * @privlevel platform
1184 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1186 * @return 0 on success, otherwise a negative error value
1187 * @retval #VC_ERROR_NONE Successful
1188 * @retval #VC_ERROR_INVALID_STATE Invalid state
1189 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1190 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1192 * @pre The state should be #VC_STATE_INITIALIZED.
1194 * @see vc_mgr_set_state_changed_cb()
1196 int vc_mgr_unset_state_changed_cb(void);
1200 * @brief Sets a callback function to be called when service state is changed.
1203 * @privlevel platform
1204 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1206 * @param[in] callback Callback function to register
1207 * @param[in] user_data The user data to be passed to the callback function
1209 * @return 0 on success, otherwise a negative error value
1210 * @retval #VC_ERROR_NONE Successful
1211 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1212 * @retval #VC_ERROR_INVALID_STATE Invalid state
1213 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1214 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1216 * @pre The state should be #VC_STATE_INITIALIZED.
1218 * @see vc_service_state_changed_cb()
1219 * @see vc_mgr_unset_service_state_changed_cb()
1221 int vc_mgr_set_service_state_changed_cb(vc_service_state_changed_cb callback, void *user_data);
1225 * @brief Unsets the service state changed callback function.
1228 * @privlevel platform
1229 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1231 * @return 0 on success, otherwise a negative error value
1232 * @retval #VC_ERROR_NONE Successful
1233 * @retval #VC_ERROR_INVALID_STATE Invalid state
1234 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1235 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1237 * @pre The state should be #VC_STATE_INITIALIZED.
1239 * @see vc_mgr_set_service_state_changed_cb()
1241 int vc_mgr_unset_service_state_changed_cb(void);
1245 * @brief Sets a callback function to be called when begin of speech is detected.
1248 * @privlevel platform
1249 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1251 * @param[in] callback Callback function to register
1252 * @param[in] user_data The user data to be passed to the callback function
1254 * @return 0 on success, otherwise a negative error value
1255 * @retval #VC_ERROR_NONE Successful
1256 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1257 * @retval #VC_ERROR_INVALID_STATE Invalid state
1258 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1259 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1261 * @pre The state should be #VC_STATE_INITIALIZED.
1263 * @see vc_mgr_begin_speech_detected_cb()
1264 * @see vc_mgr_unset_speech_detected_cb()
1266 int vc_mgr_set_speech_detected_cb(vc_mgr_begin_speech_detected_cb callback, void *user_data);
1270 * @brief Unsets the speech detected callback function.
1273 * @privlevel platform
1274 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1276 * @return 0 on success, otherwise a negative error value
1277 * @retval #VC_ERROR_NONE Successful
1278 * @retval #VC_ERROR_INVALID_STATE Invalid state
1279 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1280 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1282 * @pre The state should be #VC_STATE_INITIALIZED.
1284 * @see vc_mgr_set_speech_detected_cb()
1286 int vc_mgr_unset_speech_detected_cb(void);
1290 * @brief Sets a callback function to be called when current language is changed.
1293 * @privlevel platform
1294 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1296 * @param[in] callback Callback function to register
1297 * @param[in] user_data The user data to be passed to the callback function
1299 * @return 0 on success, otherwise a negative error value
1300 * @retval #VC_ERROR_NONE Successful
1301 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1302 * @retval #VC_ERROR_INVALID_STATE Invalid state
1303 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1304 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1306 * @pre The state should be #VC_STATE_INITIALIZED.
1308 * @see vc_current_language_changed_cb()
1309 * @see vc_mgr_unset_current_language_changed_cb()
1311 int vc_mgr_set_current_language_changed_cb(vc_current_language_changed_cb callback, void *user_data);
1315 * @brief Unsets the current language changed callback function.
1318 * @privlevel platform
1319 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1321 * @return 0 on success, otherwise a negative error value
1322 * @retval #VC_ERROR_NONE Successful
1323 * @retval #VC_ERROR_INVALID_STATE Invalid state
1324 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1325 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1327 * @pre The state should be #VC_STATE_INITIALIZED.
1329 * @see vc_mgr_set_current_language_changed_cb()
1331 int vc_mgr_unset_current_language_changed_cb(void);
1335 * @brief Gets the current error message.
1338 * @privlevel platform
1339 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1341 * @remarks This function should be called during as vc error callback. If not, the error as operation failure will be returned. \n
1342 * If the function succeeds, @a err_msg must be released using free() when it is no longer required.
1344 * @param[out] err_msg The current error message
1346 * @return 0 on success, otherwise a negative error value
1347 * @retval #VC_ERROR_NONE Successful
1348 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1349 * @retval #VC_ERROR_INVALID_STATE Invalid state
1350 * @retval $VC_ERROR_OPERATION_FAILED Operation failure
1351 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
1352 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1353 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1355 * @see vc_error_cb()
1357 int vc_mgr_get_error_message(char **err_msg);
1361 * @brief Sets a callback function to be called when an error occurred.
1364 * @privlevel platform
1365 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1367 * @param[in] callback Callback function to register
1368 * @param[in] user_data The user data to be passed to the callback function
1370 * @return 0 on success, otherwise a negative error value
1371 * @retval #VC_ERROR_NONE Successful
1372 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1373 * @retval #VC_ERROR_INVALID_STATE Invalid state
1374 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1375 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1377 * @pre The state should be #VC_STATE_INITIALIZED.
1379 * @see vc_error_cb()
1380 * @see vc_mgr_unset_error_cb()
1382 int vc_mgr_set_error_cb(vc_error_cb callback, void *user_data);
1386 * @brief Unsets the callback function to be called when an error occurred.
1389 * @privlevel platform
1390 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1392 * @return 0 on success, otherwise a negative error value
1393 * @retval #VC_ERROR_NONE Successful
1394 * @retval #VC_ERROR_INVALID_STATE Invalid state
1395 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1396 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1398 * @pre The state should be #VC_STATE_INITIALIZED.
1400 * @see vc_mgr_set_error_cb()
1402 int vc_mgr_unset_error_cb(void);
1407 * @brief Sets a callback function to be called when dialog requests.
1410 * @privlevel platform
1411 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1413 * @param[in] callback Callback function to register
1414 * @param[in] user_data The user data to be passed to the callback function
1416 * @return 0 on success, otherwise a negative error value
1417 * @retval #VC_ERROR_NONE Successful
1418 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1419 * @retval #VC_ERROR_INVALID_STATE Invalid state
1420 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1421 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1423 * @pre The state should be #VC_STATE_INITIALIZED.
1425 * @see vc_mgr_unset_dialog_request_cb()
1427 int vc_mgr_set_dialog_request_cb(vc_mgr_dialog_request_cb callback, void *user_data);
1431 * @brief Unsets the callback function to be called when dialog requests.
1434 * @privlevel platform
1435 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1437 * @return 0 on success, otherwise a negative error value
1438 * @retval #VC_ERROR_NONE Successful
1439 * @retval #VC_ERROR_INVALID_STATE Invalid state
1440 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1441 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1443 * @pre The state should be #VC_STATE_INITIALIZED.
1445 * @see vc_mgr_set_dialog_request_cb()
1447 int vc_mgr_unset_dialog_request_cb(void);
1451 * @brief Enables command type as candidate command.
1454 * @privlevel platform
1455 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1457 * @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)
1459 * @return 0 on success, otherwise a negative error value
1460 * @retval #VC_ERROR_NONE Successful
1461 * @retval #VC_ERROR_INVALID_STATE Invalid state
1462 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1463 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1464 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1466 * @pre The state should be #VC_STATE_READY.
1468 * @see vc_mgr_disable_command_type()
1470 int vc_mgr_enable_command_type(int cmd_type);
1474 * @brief Disables command type as candidate command.
1477 * @privlevel platform
1478 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1480 * @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)
1482 * @return 0 on success, otherwise a negative error value
1483 * @retval #VC_ERROR_NONE Successful
1484 * @retval #VC_ERROR_INVALID_STATE Invalid state
1485 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1486 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1487 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1489 * @pre The state should be #VC_STATE_READY.
1491 * @see vc_mgr_enable_command_type()
1493 int vc_mgr_disable_command_type(int cmd_type);
1497 * @brief Sets a callback function to be called when engine set private data.
1500 * @privlevel platform
1501 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1503 * @param[in] callback Callback function to register
1504 * @param[in] user_data The user data to be passed to the callback function
1506 * @return 0 on success, otherwise a negative error value
1507 * @retval #VC_ERROR_NONE Successful
1508 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1509 * @retval #VC_ERROR_INVALID_STATE Invalid state
1510 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1511 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1513 * @pre The state should be #VC_STATE_INITIALIZED.
1515 * @see vc_private_data_set_cb()
1516 * @see vc_mgr_unset_private_data_set_cb()
1518 int vc_mgr_set_private_data_set_cb(vc_mgr_private_data_set_cb callback, void *user_data);
1522 * @brief Unsets the callback function to be called when engine set private data.
1525 * @privlevel platform
1526 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1528 * @return 0 on success, otherwise a negative error value
1529 * @retval #VC_ERROR_NONE Successful
1530 * @retval #VC_ERROR_INVALID_STATE Invalid state
1531 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1532 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1534 * @pre The state should be #VC_STATE_INITIALIZED.
1536 * @see vc_mgr_set_private_data_set_cb()
1538 int vc_mgr_unset_private_data_set_cb(void);
1542 * @brief Sets a callback function to be called when engine request private data.
1545 * @privlevel platform
1546 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1548 * @param[in] callback Callback function to register
1549 * @param[in] user_data The user data to be passed to the callback function
1551 * @return 0 on success, otherwise a negative error value
1552 * @retval #VC_ERROR_NONE Successful
1553 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1554 * @retval #VC_ERROR_INVALID_STATE Invalid state
1555 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1556 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1558 * @pre The state should be #VC_STATE_INITIALIZED.
1560 * @see vc_private_data_requested_cb()
1561 * @see vc_mgr_unset_private_data_requested_cb()
1563 int vc_mgr_set_private_data_requested_cb(vc_mgr_private_data_requested_cb callback, void *user_data);
1567 * @brief Unsets the callback function to be called when engine request private data.
1570 * @privlevel platform
1571 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1573 * @return 0 on success, otherwise a negative error value
1574 * @retval #VC_ERROR_NONE Successful
1575 * @retval #VC_ERROR_INVALID_STATE Invalid state
1576 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1577 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1579 * @pre The state should be #VC_STATE_INITIALIZED.
1581 * @see vc_mgr_set_private_data_requested_cb()
1583 int vc_mgr_unset_private_data_requested_cb(void);
1585 /* for TTS feedback */
1588 * @brief Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1591 * @param[in] callback Callback function to set
1592 * @param[in] user_data The user data to be passed to the callback function
1594 * @privlevel platform
1595 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1597 * @return 0 on success, otherwise a negative error value
1598 * @retval #VC_ERROR_NONE Successful
1599 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1600 * @retval #VC_ERROR_INVALID_STATE Invalid state
1601 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1602 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1604 * @pre The state should be #VC_STATE_INITIALIZED.
1606 * @see vc_mgr_feedback_audio_format_cb()
1607 * @see vc_mgr_unset_feedback_audio_format_cb()
1609 int vc_mgr_set_feedback_audio_format_cb(vc_mgr_feedback_audio_format_cb callback, void* user_data);
1613 * @brief Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1616 * @privlevel platform
1617 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1619 * @return 0 on success, otherwise a negative error value
1620 * @retval #VC_ERROR_NONE Successful
1621 * @retval #VC_ERROR_INVALID_STATE Invalid state
1622 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1623 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1625 * @pre The state should be #VC_STATE_INITIALIZED.
1627 * @see vc_mgr_feedback_audio_format_cb()
1628 * @see vc_mgr_set_feedback_audio_format_cb()
1630 int vc_mgr_unset_feedback_audio_format_cb(void);
1634 * @brief Sets a callback function to be called when engine sends audio streaming for TTS feedback.
1637 * @param[in] callback Callback function to set
1638 * @param[in] user_data The user data to be passed to the callback function
1640 * @privlevel platform
1641 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1643 * @return 0 on success, otherwise a negative error value
1644 * @retval #VC_ERROR_NONE Successful
1645 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1646 * @retval #VC_ERROR_INVALID_STATE Invalid state
1647 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1648 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1650 * @pre The state should be #VC_STATE_INITIALIZED.
1652 * @see vc_mgr_feedback_streaming_cb()
1653 * @see vc_mgr_unset_feedback_streaming_cb()
1655 int vc_mgr_set_feedback_streaming_cb(vc_mgr_feedback_streaming_cb callback, void* user_data);
1659 * @brief Unsets a callback function to be called when engine sends audio streaming for TTS feedback.
1662 * @privlevel platform
1663 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1665 * @return 0 on success, otherwise a negative error value
1666 * @retval #VC_ERROR_NONE Successful
1667 * @retval #VC_ERROR_INVALID_STATE Invalid state
1668 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1669 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1671 * @pre The state should be #VC_STATE_INITIALIZED.
1673 * @see vc_mgr_feedback_streaming_cb()
1674 * @see vc_mgr_set_feedback_streaming_cb()
1676 int vc_mgr_unset_feedback_streaming_cb(void);
1680 * @brief Starts getting TTS feedback streaming data from the buffer.
1683 * @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().
1685 * @privlevel platform
1686 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1688 * @return 0 on success, otherwise a negative error value
1689 * @retval #VC_ERROR_NONE Successful
1690 * @retval #VC_ERROR_INVALID_STATE Invalid state
1691 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1692 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1694 * @pre The state should be #VC_STATE_READY. \n
1695 * 'vc_mgr_feedback_streaming_cb()' should be registered.
1697 * @see vc_mgr_feedback_streaming_cb()
1698 * @see vc_mgr_set_feedback_streaming_cb()
1699 * @see vc_mgr_unset_feedback_streaming_cb()
1700 * @see vc_mgr_stop_feedback()
1702 int vc_mgr_start_feedback(void);
1706 * @brief Stops getting and removes TTS feedback streaming data from the buffer.
1709 * @privlevel platform
1710 * @privilege %http://tizen.org/privilege/voicecontrol.manager
1712 * @return 0 on success, otherwise a negative error value
1713 * @retval #VC_ERROR_NONE Successful
1714 * @retval #VC_ERROR_INVALID_STATE Invalid state
1715 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1716 * @retval #VC_ERROR_NOT_SUPPORTED VC not supported
1718 * @pre The state should be #VC_STATE_READY.
1720 * @see vc_mgr_feedback_streaming_cb()
1721 * @see vc_mgr_set_feedback_streaming_cb()
1722 * @see vc_mgr_unset_feedback_streaming_cb()
1723 * @see vc_mgr_start_feedback()
1725 int vc_mgr_stop_feedback(void);
1728 * @brief Sets TTS streaming callback function.
1731 * @param[in] callback The callback function
1732 * @param[in] user_data The user data to be passed to the callback function
1734 * @return 0 on success, otherwise a negative error value
1735 * @retval #VC_ERROR_NONE Successful
1736 * @retval #VC_ERROR_INVALID_STATE Invalid state
1737 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1739 * @pre The state should be #VC_STATE_INITIALIZED.
1741 * @see vc_mgr_vc_tts_streaming_cb()
1742 * @see vc_mgr_unset_vc_tts_streaming_cb()
1744 int vc_mgr_set_vc_tts_streaming_cb(vc_mgr_vc_tts_streaming_cb callback, void* user_data);
1747 * @brief Unsets TTS streaming callback function.
1750 * @return 0 on success, otherwise a negative error value
1751 * @retval #VC_ERROR_NONE Successful
1752 * @retval #VC_ERROR_INVALID_STATE Invalid state
1754 * @pre The state should be #VC_STATE_INITIALIZED.
1756 * @see vc_mgr_vc_tts_streaming_cb()
1757 * @see vc_mgr_set_vc_tts_streaming_cb()
1759 int vc_mgr_unset_vc_tts_streaming_cb(void);
1770 #endif /* __VOICE_CONTROL_MANAGER_H__ */