2 * Copyright (c) 2011-2016 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_H__
19 #define __VOICE_CONTROL_H__
22 #include <voice_control_command.h>
23 #include <voice_control_common.h>
27 * @addtogroup CAPI_UIX_VOICE_CONTROL_MODULE
39 * @file voice_control.h
40 * @brief This file contains the voice control client API and related callback definitions and enums.
45 * @file voice_control_command.h
46 * @brief This file contains the command list and command API and related handle definitions and enums.
51 * @file voice_control_common.h
52 * @brief This file contains the callback function definitions and enums.
57 * @brief Definition for foreground command type.
58 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
60 #define VC_COMMAND_TYPE_FOREGROUND 1
64 * @brief Definition for background command type.
65 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
67 #define VC_COMMAND_TYPE_BACKGROUND 2
71 * @brief Definition for ended dialog.
74 #define VC_DIALOG_END 0
78 * @brief Definition for continued dialog.
81 #define VC_DIALOG_CONTINUE 1
85 * @brief Initializes voice control.
86 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
88 * @privilege %http://tizen.org/privilege/recorder
89 * @remarks If the function succeeds, vc must be released with vc_deinitialize().
90 * @return @c 0 on success,
91 * otherwise a negative error value
92 * @retval #VC_ERROR_NONE Successful
93 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
94 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
95 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
96 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
97 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
98 * @see vc_deinitialize()
100 int vc_initialize(void);
104 * @brief Deinitializes voice control.
105 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
107 * @privilege %http://tizen.org/privilege/recorder
108 * @return @c 0 on success,
109 * otherwise a negative error value
110 * @retval #VC_ERROR_NONE Successful
111 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
112 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
113 * @retval #VC_ERROR_INVALID_STATE Invalid state
114 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
115 * @see vc_initialize()
117 int vc_deinitialize(void);
121 * @brief Connects the voice control service.
122 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
124 * @privilege %http://tizen.org/privilege/recorder
125 * @return @c 0 on success,
126 * otherwise a negative error value
127 * @retval #VC_ERROR_NONE Successful
128 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
129 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
130 * @retval #VC_ERROR_INVALID_STATE Invalid state
131 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
132 * @pre The state should be #VC_STATE_INITIALIZED.
133 * @post If this function is called, the state will be #VC_STATE_READY.
134 * @see vc_unprepare()
136 int vc_prepare(void);
140 * @brief Disconnects the voice control service.
141 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
143 * @privilege %http://tizen.org/privilege/recorder
144 * @return @c 0 on success,
145 * otherwise a negative error value
146 * @retval #VC_ERROR_NONE Successful
147 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
148 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
149 * @retval #VC_ERROR_INVALID_STATE Invalid state
150 * @pre The state should be #VC_STATE_READY.
151 * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
154 int vc_unprepare(void);
158 * @brief Retrieves all supported languages using callback function.
159 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
161 * @privilege %http://tizen.org/privilege/recorder
162 * @param[in] callback Callback function to invoke
163 * @param[in] user_data The user data to be passed to the callback function
164 * @return @c 0 on success,
165 * otherwise a negative error value
166 * @retval #VC_ERROR_NONE Successful
167 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
168 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
169 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
170 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
171 * @retval #VC_ERROR_INVALID_STATE Invalid state
172 * @pre The state should be #VC_STATE_INITIALIZED or #VC_STATE_READY.
173 * @post This function invokes vc_supported_language_cb() repeatedly for getting languages.
174 * @see vc_supported_language_cb()
175 * @see vc_get_current_language()
177 int vc_foreach_supported_languages(vc_supported_language_cb callback, void* user_data);
181 * @brief Gets current language.
182 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
184 * @privilege %http://tizen.org/privilege/recorder
185 * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it.
186 * @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code
187 * followed by ISO 639-1 for the two-letter language code.
188 * For example, "ko_KR" for Korean, "en_US" for American English
189 * @return @c 0 on success,
190 * otherwise a negative error value
191 * @retval #VC_ERROR_NONE Successful
192 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
193 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
194 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
195 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
196 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
197 * @retval #VC_ERROR_INVALID_STATE Invalid state
198 * @pre The state should be #VC_STATE_INITIALIZED or #VC_STATE_READY.
199 * @see vc_foreach_supported_languages()
201 int vc_get_current_language(char** language);
205 * @brief Gets current state of voice control client.
206 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
208 * @privilege %http://tizen.org/privilege/recorder
209 * @param[out] state The current state
210 * @return @c 0 on success,
211 * otherwise a negative error value
212 * @retval #VC_ERROR_NONE Successful
213 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
214 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
215 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
216 * @see vc_state_changed_cb()
217 * @see vc_set_state_changed_cb()
219 int vc_get_state(vc_state_e* state);
223 * @brief Gets current state of voice control service.
224 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
226 * @privilege %http://tizen.org/privilege/recorder
227 * @param[out] state The current state
228 * @return @c 0 on success,
229 * otherwise a negative error value
230 * @retval #VC_ERROR_NONE Successful
231 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
232 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
233 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
234 * @pre The state should be #VC_STATE_READY.
235 * @see vc_set_service_state_changed_cb()
236 * @see vc_unset_service_state_changed_cb()
238 int vc_get_service_state(vc_service_state_e* state);
242 * @brief Gets the system command list.
245 * @privilege %http://tizen.org/privilege/recorder
246 * @remarks In the system command list, there are system commands predefined by product manufacturers. Those commands have the highest priority.
247 * Therefore, the user can not set any commands same with the system commands.
248 * The @a vc_sys_cmd_list must be released using vc_cmd_list_destroy() when it is no longer required.
249 * @param[out] vc_sys_cmd_list System command list handle
250 * @return @c 0 on success,
251 * otherwise a negative error value
252 * @retval #VC_ERROR_NONE Successful
253 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
254 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
255 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
256 * @retval #VC_ERROR_INVALID_STATE Invalid state
257 * @pre The service state should be #VC_SERVICE_STATE_READY.
258 * @see vc_cmd_list_destroy()
260 int vc_get_system_command_list(vc_cmd_list_h* vc_sys_cmd_list);
264 * @brief Sets the invocation name.
265 * @details Invocation name is used to activate background commands. The invocation name can be the same as the application name or any other phrase.
266 * For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample".
267 * In order to activate the background command, users can say "Tizen Sample, Play music".
268 * The invocation name is dependent on the current language. For example, if the current language is "en_US"(English), the invocation name is also "en_US".
269 * If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized.
270 * This function should be called before vc_set_command_list().
273 * @privilege %http://tizen.org/privilege/recorder
274 * @remarks If @a name is @c NULL, the invocation name will be unset.
275 * @param[in] name Invocation name that an application wants to be invoked by
276 * @return @c 0 on success,
277 * otherwise a negative error value
278 * @retval #VC_ERROR_NONE Successful
279 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
280 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
281 * @retval #VC_ERROR_INVALID_STATE Invalid state
282 * @pre The state should be #VC_STATE_READY.
283 * @see vc_set_command_list()
285 int vc_set_invocation_name(const char* name);
289 * @brief Requests to set app id which is to want to ask the server dialogue.
290 * @details Using this function, the developer can request registering the application on vc framework.
291 * If developer requests to register @a app_id with @a credential which is valid, the application will be set on vc framework.
292 * and then, when the developer requests the dialogue using vc_request_dialog(), dialog from specific engine server will be played by vc framework.
295 * @privilege %http://tizen.org/privilege/recorder
296 * @remarks If @a app_id is @c NULL, the API tries to get app ID using app manager framework.
297 * However, getting app ID may be failed.
298 * @param[in] app_id App id which is to want to ask server dialog.
299 * @param[in] credential Credential key.
300 * @return @c 0 on success,
301 * otherwise a negative error value
302 * @retval #VC_ERROR_NONE Successful
303 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
304 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
305 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
306 * @retval #VC_ERROR_INVALID_STATE Invalid state
307 * @pre The service state should be #VC_SERVICE_STATE_READY.
308 * @see vc_unset_server_dialog()
310 int vc_set_server_dialog(const char* app_id, const char* credential);
314 * @brief Requests to unset app id which is to not want to ask the server dialogue.
315 * @details Using this function, the developer can disable function to ask dialog based on server.
318 * @privilege %http://tizen.org/privilege/recorder
319 * @remarks If @a app_id is @c NULL, the API tries to get app ID using app manager framework.
320 * However, getting app ID may be failed.
321 * @param[in] app_id App id which is to not want to ask server dialog.
322 * @return @c 0 on success,
323 * otherwise a negative error value
324 * @retval #VC_ERROR_NONE Successful
325 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
326 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
327 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
328 * @retval #VC_ERROR_INVALID_STATE Invalid state
329 * @pre The service state should be #VC_SERVICE_STATE_READY.
330 * @see vc_set_server_dialog()
332 int vc_unset_server_dialog(const char* app_id);
336 * @brief Requests to start the dialogue.
337 * @details Using this function, the developer can request starting the dialogue to the framework.
338 * When the developer requests the dialogue, two types of texts, @a disp_text and @a utt_text, can be sent by this function.
339 * @a disp_text is a text for displaying, and @a utt_text is that for uttering.
340 * For example, if @a disp_text is "October 10th" and @a utt_text is "Today is October 10th.", "October 10th" will be displayed on the screen and "Today is October 10th." will be spoken.
341 * Also, the developer can set whether the dialogue starts automatically or not, using @a auto_start.
342 * If the developer sets @a auto_start as @c true, the framework will start to record next speech and continue the dialogue.
345 * @privilege %http://tizen.org/privilege/recorder
346 * @remarks If @a auto_start is @c true, the recognition will start again. In this case, it can be restarted up to 4 times.
347 * @a disp_text and @a utt_text allow @c NULL. However, it is not allowed to set both @a disp_text and @a utt_text as @c NULL.
348 * @param[in] disp_text Text to be displayed on the screen
349 * @param[in] utt_text Text to be spoken
350 * @param[in] auto_start A variable for setting whether the dialog session will be restarted automatically or not
351 * @return @c 0 on success,
352 * otherwise a negative error value
353 * @retval #VC_ERROR_NONE Successful
354 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
355 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
356 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
357 * @retval #VC_ERROR_INVALID_STATE Invalid state
358 * @pre The service state should be #VC_SERVICE_STATE_READY.
360 int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_start);
364 * @brief Sets command list.
365 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
367 * @privilege %http://tizen.org/privilege/recorder
368 * @remarks The command type is valid for #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND.
369 * The matched commands of command list should be set and they should include type and command text at least.
370 * @param[in] vc_cmd_list Command list handle
371 * @param[in] type Command type
372 * @return @c 0 on success,
373 * otherwise a negative error value
374 * @retval #VC_ERROR_NONE Successful
375 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
376 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
377 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #VC_ERROR_INVALID_STATE Invalid state
379 * @pre The state should be #VC_STATE_READY.
380 * @see vc_unset_command_list()
382 int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type);
386 * @brief Unsets command list.
387 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
389 * @privilege %http://tizen.org/privilege/recorder
390 * @param[in] type Command type
391 * @return @c 0 on success,
392 * otherwise a negative error value
393 * @retval #VC_ERROR_NONE Successful
394 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
395 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
396 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
397 * @retval #VC_ERROR_INVALID_STATE Invalid state
398 * @pre The state should be #VC_STATE_READY.
399 * @see vc_set_command_list()
401 int vc_unset_command_list(int type);
405 * @brief Gets the recognition result.
408 * @privilege %http://tizen.org/privilege/recorder
409 * @param[in] callback Callback function to get recognition result
410 * @param[in] user_data The user data to be passed to the callback function
411 * @return @c 0 on success,
412 * otherwise a negative error value
413 * @retval #VC_ERROR_NONE Successful
414 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
415 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
416 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
417 * @retval #VC_ERROR_INVALID_STATE Invalid state
418 * @pre The state should be #VC_STATE_READY.
419 * @see vc_result_cb()
421 int vc_get_result(vc_result_cb callback, void* user_data);
425 * @brief Sets a callback function for getting recognition result.
426 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
428 * @privilege %http://tizen.org/privilege/recorder
429 * @param[in] callback Callback function to register
430 * @param[in] user_data The user data to be passed to the callback function
431 * @return @c 0 on success,
432 * otherwise a negative error value
433 * @retval #VC_ERROR_NONE Successful
434 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
435 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
436 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
437 * @retval #VC_ERROR_INVALID_STATE Invalid state
438 * @pre The state should be #VC_STATE_INITIALIZED.
439 * @see vc_result_cb()
440 * @see vc_unset_result_cb()
442 int vc_set_result_cb(vc_result_cb callback, void* user_data);
446 * @brief Unsets the callback function.
447 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
449 * @privilege %http://tizen.org/privilege/recorder
450 * @return @c 0 on success,
451 * otherwise a negative error value
452 * @retval #VC_ERROR_NONE Successful
453 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
454 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
455 * @retval #VC_ERROR_INVALID_STATE Invalid state
456 * @pre The state should be #VC_STATE_INITIALIZED.
457 * @see vc_set_result_cb()
459 int vc_unset_result_cb(void);
463 * @brief Sets a callback function to be called when service state is changed.
464 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
466 * @privilege %http://tizen.org/privilege/recorder
467 * @param[in] callback Callback function to register
468 * @param[in] user_data The user data to be passed to the callback function
469 * @return @c 0 on success,
470 * otherwise a negative error value
471 * @retval #VC_ERROR_NONE Successful
472 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
473 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
474 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
475 * @retval #VC_ERROR_INVALID_STATE Invalid state
476 * @pre The state should be #VC_STATE_INITIALIZED.
477 * @see vc_service_state_changed_cb()
478 * @see vc_unset_service_state_changed_cb()
480 int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data);
484 * @brief Unsets the callback function.
485 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
487 * @privilege %http://tizen.org/privilege/recorder
488 * @return @c 0 on success,
489 * otherwise a negative error value
490 * @retval #VC_ERROR_NONE Successful
491 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
492 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
493 * @retval #VC_ERROR_INVALID_STATE Invalid state
494 * @pre The state should be #VC_STATE_INITIALIZED.
495 * @see vc_set_service_state_changed_cb()
497 int vc_unset_service_state_changed_cb(void);
501 * @brief Sets a callback function to be called when state is changed.
502 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
504 * @privilege %http://tizen.org/privilege/recorder
505 * @param[in] callback Callback function to register
506 * @param[in] user_data The user data to be passed to the callback function
507 * @return @c 0 on success,
508 * otherwise a negative error value
509 * @retval #VC_ERROR_NONE Successful
510 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
511 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
512 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
513 * @retval #VC_ERROR_INVALID_STATE Invalid state
514 * @pre The state should be #VC_STATE_INITIALIZED.
515 * @see vc_state_changed_cb()
516 * @see vc_unset_state_changed_cb()
518 int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data);
522 * @brief Unsets the callback function.
523 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
525 * @privilege %http://tizen.org/privilege/recorder
526 * @return @c 0 on success,
527 * otherwise a negative error value
528 * @retval #VC_ERROR_NONE Successful
529 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
530 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
531 * @retval #VC_ERROR_INVALID_STATE Invalid state
532 * @pre The state should be #VC_STATE_INITIALIZED.
533 * @see vc_set_state_changed_cb()
535 int vc_unset_state_changed_cb(void);
539 * @brief Sets a callback function to be called when current language is changed.
540 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
542 * @privilege %http://tizen.org/privilege/recorder
543 * @param[in] callback Callback function to register
544 * @param[in] user_data The user data to be passed to the callback function
545 * @return @c 0 on success,
546 * otherwise a negative error value
547 * @retval #VC_ERROR_NONE Successful
548 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
549 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
550 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
551 * @retval #VC_ERROR_INVALID_STATE Invalid state
552 * @pre The state should be #VC_STATE_INITIALIZED.
553 * @see vc_current_language_changed_cb()
554 * @see vc_unset_current_language_changed_cb()
556 int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback, void* user_data);
560 * @brief Unsets the callback function.
561 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
563 * @privilege %http://tizen.org/privilege/recorder
564 * @return @c 0 on success,
565 * otherwise a negative error value
566 * @retval #VC_ERROR_NONE Successful
567 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
568 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
569 * @retval #VC_ERROR_INVALID_STATE Invalid state
570 * @pre The state should be #VC_STATE_INITIALIZED.
571 * @see vc_set_current_language_changed_cb()
573 int vc_unset_current_language_changed_cb(void);
577 * @brief Sets a callback function to be called when an error occurred.
578 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
580 * @privilege %http://tizen.org/privilege/recorder
581 * @param[in] callback Callback function to register
582 * @param[in] user_data The user data to be passed to the callback function
583 * @return @c 0 on success,
584 * otherwise a negative error value
585 * @retval #VC_ERROR_NONE Successful
586 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
587 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
588 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
589 * @retval #VC_ERROR_INVALID_STATE Invalid state
590 * @pre The state should be #VC_STATE_INITIALIZED.
592 * @see vc_unset_error_cb()
594 int vc_set_error_cb(vc_error_cb callback, void* user_data);
598 * @brief Unsets the callback function.
599 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
601 * @privilege %http://tizen.org/privilege/recorder
602 * @return @c 0 on success,
603 * otherwise a negative error value
604 * @retval #VC_ERROR_NONE Successful
605 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
606 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
607 * @retval #VC_ERROR_INVALID_STATE Invalid state
608 * @pre The state should be #VC_STATE_INITIALIZED.
609 * @see vc_set_error_cb()
611 int vc_unset_error_cb(void);
616 * @brief Requests to send TTS streaming data, asynchronously.
617 * @details Using this function, the developer can request text to speech to the framework.
618 * When the developer requests the TTS with @a language, VC engine will send PCM data which is synthesized using VC engine's own persona.
619 * If @a to_vc_manager is true, the synthesized PCM data will be delivered to the VC manager, otherwise it will be delivered to the VC client
620 * For example, if @a text is "Alarm is set as 7 PM" and @a to_vc_manager is true, the PCM data corresponding "Alarm is set as 7 PM" will be delivered to VC manager client,
621 * and then it will be spoken in VC manager. If @a to_vc_manager is false, you will receive PCM data through the vc_tts_streaming_cb() callback function if it was set using vc_tts_set_streaming_cb().
622 * This function is executed asynchronously, so if there is an error while synthesizing, vc_error_cb() will be called.
625 * @privilege %http://tizen.org/privilege/voicecontrol.tts
626 * @param[in] text The text to be requested for TTS
627 * @param[in] language The language is specified as an ISO 3166 alpha-2 two-letter country code
628 * followed by ISO 639-1 for the two-letter language code.
629 * For example, "ko_KR" for Korean, "en_US" for American English
630 * @param[in] to_vc_manager The value for selection between VC client and VC manager\n
631 * If @c true, the synthesized PCM data will be delivered to the VC manager, otherwise it will be delivered to the VC client
632 * @param[out] utt_id The utterance id
633 * @return @c 0 on success,
634 * otherwise a negative error value
635 * @retval #VC_ERROR_NONE Successful
636 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
637 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
638 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
639 * @retval #VC_ERROR_INVALID_STATE Invalid state
640 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
641 * @pre The state should be #VC_STATE_READY.
642 * @see vc_tts_cancel()
644 int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id);
649 * @brief Requests to cancel TTS streaming data.
652 * @privilege %http://tizen.org/privilege/voicecontrol.tts
653 * @param[in] utt_id The utterance id
654 * @return @c 0 on success,
655 * otherwise a negative error value
656 * @retval #VC_ERROR_NONE Successful
657 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
658 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
659 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
660 * @retval #VC_ERROR_INVALID_STATE Invalid state
661 * @pre The state should be #VC_STATE_READY.
662 * @see vc_tts_request()
664 int vc_tts_cancel(int utt_id);
669 * @brief Gets the TTS audio details.
670 * @details Using this function, the developer can get details of synthesized audio data which is requested by vc_tts_request() function.
673 * @privilege %http://tizen.org/privilege/voicecontrol.tts
674 * @param[out] rate The audio sampling rate
675 * @param[out] channel The audio channel
676 * @param[out] audio_type The audio type
677 * @return @c 0 on success,
678 * otherwise a negative error value
679 * @retval #VC_ERROR_NONE Successful
680 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
681 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
682 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
683 * @retval #VC_ERROR_INVALID_STATE Invalid state
684 * @pre The state should be #VC_STATE_READY.
686 int vc_tts_get_synthesized_audio_details(int* rate, vc_audio_channel_e* channel, vc_audio_type_e* audio_type);
691 * @brief Sets the TTS streaming callback function.
694 * @privilege %http://tizen.org/privilege/voicecontrol.tts
695 * @param[in] callback The callback function
696 * @param[in] user_data The user data to be passed to the callback function
697 * @return @c 0 on success,
698 * otherwise a negative error value
699 * @retval #VC_ERROR_NONE Successful
700 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
701 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
702 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
703 * @retval #VC_ERROR_INVALID_STATE Invalid state
704 * @pre The state should be #VC_STATE_INITIALIZED.
706 int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data);
711 * @brief Unsets the TTS streaming callback function.
714 * @privilege %http://tizen.org/privilege/voicecontrol.tts
715 * @return @c 0 on success,
716 * otherwise a negative error value
717 * @retval #VC_ERROR_NONE Successful
718 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
719 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
720 * @retval #VC_ERROR_INVALID_STATE Invalid state
721 * @pre The state should be #VC_STATE_INITIALIZED.
723 int vc_tts_unset_streaming_cb(void);
728 * @brief Sets the TTS utterance status callback function.
729 * @details Using this function, the developer can set the utterance status callback to be called
730 * when the VC manager client starts or stops playing TTS PCM data which was requested to be synthesized with the vc_tts_request() function.
731 * This function is called when to_vc_manager in the vc_tts_request() function call is @c true.
734 * @privilege %http://tizen.org/privilege/voicecontrol.tts
735 * @param[in] callback The callback function
736 * @param[in] user_data The user data to be passed to the callback function
737 * @return @c 0 on success,
738 * otherwise a negative error value
739 * @retval #VC_ERROR_NONE Successful
740 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
741 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
742 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
743 * @retval #VC_ERROR_INVALID_STATE Invalid state
744 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
745 * @pre The state should be #VC_STATE_INITIALIZED.
747 int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data);
752 * @brief Unsets the TTS utterance status callback function.
755 * @privilege %http://tizen.org/privilege/voicecontrol.tts
756 * @return @c 0 on success,
757 * otherwise a negative error value
758 * @retval #VC_ERROR_NONE Successful
759 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
760 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
761 * @retval #VC_ERROR_INVALID_STATE Invalid state
762 * @pre The state should be #VC_STATE_INITIALIZED.
764 int vc_tts_unset_utterance_status_cb(void);
775 #endif /* __VOICE_CONTROL_H__ */