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_OUT_OF_MEMORY Out of memory
94 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
95 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
96 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_STATE Invalid state
112 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
113 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
114 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_STATE Invalid state
129 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
130 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
131 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_STATE Invalid state
148 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
149 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_PARAMETER Invalid parameter
168 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
169 * @retval #VC_ERROR_INVALID_STATE Invalid state
170 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
171 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_PARAMETER Invalid parameter
193 * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
194 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
195 * @retval #VC_ERROR_INVALID_STATE Invalid state
196 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
197 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_PARAMETER Invalid parameter
214 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
215 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_PARAMETER Invalid parameter
232 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
233 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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_INVALID_PARAMETER Invalid parameter
254 * @retval #VC_ERROR_INVALID_STATE Invalid state
255 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
256 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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.
267 * @privilege %http://tizen.org/privilege/recorder
268 * @remarks Invocation name is used to activate background commands. The invocation name can be the same as the application name or any other phrase.
269 * For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample".
270 * In order to activate the background command, users can say "Tizen Sample, Play music".
271 * 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".
272 * If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized.
273 * This function should be called before vc_set_command_list().
274 * @param[in] name Invocation name that an application wants to be invoked by
275 * @return @c 0 on success,
276 * otherwise a negative error value
277 * @retval #VC_ERROR_NONE Successful
278 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
279 * @retval #VC_ERROR_INVALID_STATE Invalid state
280 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
281 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
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 * @param[in] app_id App id which is to want to ask server dialog.
297 * @param[in] credential Credential key.
298 * @return @c 0 on success,
299 * otherwise a negative error value
300 * @retval #VC_ERROR_NONE Successful
301 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
302 * @retval #VC_ERROR_INVALID_STATE Invalid state
303 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
304 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
305 * @pre The service state should be #VC_SERVICE_STATE_READY.
306 * @see vc_unset_server_dialog()
308 int vc_set_server_dialog(const char* app_id, const char* credential);
312 * @brief Requests to unset app id which is to not want to ask the server dialogue.
313 * @details Using this function, the developer can disable function to ask dialog based on server.
316 * @privilege %http://tizen.org/privilege/recorder
317 * @param[in] app_id App id which is to not want to ask server dialog.
318 * @return @c 0 on success,
319 * otherwise a negative error value
320 * @retval #VC_ERROR_NONE Successful
321 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
322 * @retval #VC_ERROR_INVALID_STATE Invalid state
323 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
324 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
325 * @pre The service state should be #VC_SERVICE_STATE_READY.
326 * @see vc_set_server_dialog()
328 int vc_unset_server_dialog(const char* app_id);
332 * @brief Requests to start the dialogue.
333 * @details Using this function, the developer can request starting the dialogue to the framework.
334 * When the developer requests the dialogue, two types of texts, @a disp_text and @a utt_text, can be sent by this function.
335 * @a disp_text is a text for displaying, and @a utt_text is that for uttering.
336 * 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.
337 * Also, the developer can set whether the dialogue starts automatically or not, using @a auto_start.
338 * If the developer sets @a auto_start as @c true, the framework will start to record next speech and continue the dialogue.
341 * @privilege %http://tizen.org/privilege/recorder
342 * @remarks If @a auto_start is @c true, the recognition will start again. In this case, it can be restarted up to 4 times.
343 * @param[in] disp_text Text to be displayed on the screen
344 * @param[in] utt_text Text to be spoken
345 * @param[in] auto_start A variable for setting whether the dialog session will be restarted automatically or not
346 * @return @c 0 on success,
347 * otherwise a negative error value
348 * @retval #VC_ERROR_NONE Successful
349 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
350 * @retval #VC_ERROR_INVALID_STATE Invalid state
351 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
352 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
353 * @pre The service state should be #VC_SERVICE_STATE_READY.
355 int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_start);
359 * @brief Sets command list.
360 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
362 * @privilege %http://tizen.org/privilege/recorder
363 * @remarks The command type is valid for #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND.
364 * The matched commands of command list should be set and they should include type and command text at least.
365 * @param[in] vc_cmd_list Command list handle
366 * @param[in] type Command type
367 * @return @c 0 on success,
368 * otherwise a negative error value
369 * @retval #VC_ERROR_NONE Successful
370 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
371 * @retval #VC_ERROR_INVALID_STATE Invalid state
372 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
373 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
374 * @pre The state should be #VC_STATE_READY.
375 * @see vc_unset_command_list()
377 int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type);
381 * @brief Unsets command list.
382 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
384 * @privilege %http://tizen.org/privilege/recorder
385 * @param[in] type Command type
386 * @return @c 0 on success,
387 * otherwise a negative error value
388 * @retval #VC_ERROR_NONE Successful
389 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
390 * @retval #VC_ERROR_INVALID_STATE Invalid state
391 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
392 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
393 * @pre The state should be #VC_STATE_READY.
394 * @see vc_set_command_list()
396 int vc_unset_command_list(int type);
400 * @brief Gets the recognition result.
403 * @privilege %http://tizen.org/privilege/recorder
404 * @param[in] callback Callback function to get recognition result
405 * @param[in] user_data The user data to be passed to the callback function
406 * @return @c 0 on success,
407 * otherwise a negative error value
408 * @retval #VC_ERROR_NONE Successful
409 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
410 * @retval #VC_ERROR_INVALID_STATE Invalid state
411 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
412 * @pre The state should be #VC_STATE_READY.
413 * @see vc_result_cb()
415 int vc_get_result(vc_result_cb callback, void* user_data);
419 * @brief Registers a callback function for getting recognition result.
420 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
422 * @privilege %http://tizen.org/privilege/recorder
423 * @param[in] callback Callback function to register
424 * @param[in] user_data The user data to be passed to the callback function
425 * @return @c 0 on success,
426 * otherwise a negative error value
427 * @retval #VC_ERROR_NONE Successful
428 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
429 * @retval #VC_ERROR_INVALID_STATE Invalid state
430 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
431 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
432 * @pre The state should be #VC_STATE_INITIALIZED.
433 * @see vc_result_cb()
434 * @see vc_unset_result_cb()
436 int vc_set_result_cb(vc_result_cb callback, void* user_data);
440 * @brief Unregisters the callback function.
441 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
443 * @privilege %http://tizen.org/privilege/recorder
444 * @return @c 0 on success,
445 * otherwise a negative error value
446 * @retval #VC_ERROR_NONE Successful
447 * @retval #VC_ERROR_INVALID_STATE Invalid state
448 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
449 * @pre The state should be #VC_STATE_INITIALIZED.
450 * @see vc_set_result_cb()
452 int vc_unset_result_cb(void);
456 * @brief Registers a callback function to be called when state is changed.
457 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
459 * @privilege %http://tizen.org/privilege/recorder
460 * @param[in] callback Callback function to register
461 * @param[in] user_data The user data to be passed to the callback function
462 * @return @c 0 on success,
463 * otherwise a negative error value
464 * @retval #VC_ERROR_NONE Successful
465 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
466 * @retval #VC_ERROR_INVALID_STATE Invalid state
467 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
468 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
469 * @pre The state should be #VC_STATE_INITIALIZED.
470 * @see vc_service_state_changed_cb()
471 * @see vc_unset_service_state_changed_cb()
473 int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data);
477 * @brief Unregisters the callback function.
478 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
480 * @privilege %http://tizen.org/privilege/recorder
481 * @return @c 0 on success,
482 * otherwise a negative error value
483 * @retval #VC_ERROR_NONE Successful
484 * @retval #VC_ERROR_INVALID_STATE Invalid state
485 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
486 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
487 * @pre The state should be #VC_STATE_INITIALIZED.
488 * @see vc_set_service_state_changed_cb()
490 int vc_unset_service_state_changed_cb(void);
494 * @brief Registers a callback function to be called when state is changed.
495 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
497 * @privilege %http://tizen.org/privilege/recorder
498 * @param[in] callback Callback function to register
499 * @param[in] user_data The user data to be passed to the callback function
500 * @return @c 0 on success,
501 * otherwise a negative error value
502 * @retval #VC_ERROR_NONE Successful
503 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
504 * @retval #VC_ERROR_INVALID_STATE Invalid state
505 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
506 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
507 * @pre The state should be #VC_STATE_INITIALIZED.
508 * @see vc_state_changed_cb()
509 * @see vc_unset_state_changed_cb()
511 int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data);
515 * @brief Unregisters the callback function.
516 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
518 * @privilege %http://tizen.org/privilege/recorder
519 * @return @c 0 on success,
520 * otherwise a negative error value
521 * @retval #VC_ERROR_NONE Successful
522 * @retval #VC_ERROR_INVALID_STATE Invalid state
523 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
524 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
525 * @pre The state should be #VC_STATE_INITIALIZED.
526 * @see vc_set_state_changed_cb()
528 int vc_unset_state_changed_cb(void);
532 * @brief Registers a callback function to be called when current language is changed.
533 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
535 * @privilege %http://tizen.org/privilege/recorder
536 * @param[in] callback Callback function to register
537 * @param[in] user_data The user data to be passed to the callback function
538 * @return @c 0 on success,
539 * otherwise a negative error value
540 * @retval #VC_ERROR_NONE Successful
541 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
542 * @retval #VC_ERROR_INVALID_STATE Invalid state
543 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
544 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
545 * @pre The state should be #VC_STATE_INITIALIZED.
546 * @see vc_current_language_changed_cb()
547 * @see vc_unset_current_language_changed_cb()
549 int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback, void* user_data);
553 * @brief Unregisters the callback function.
554 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
556 * @privilege %http://tizen.org/privilege/recorder
557 * @return @c 0 on success,
558 * otherwise a negative error value
559 * @retval #VC_ERROR_NONE Successful
560 * @retval #VC_ERROR_INVALID_STATE Invalid state
561 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
562 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
563 * @pre The state should be #VC_STATE_INITIALIZED.
564 * @see vc_set_current_language_changed_cb()
566 int vc_unset_current_language_changed_cb(void);
570 * @brief Registers a callback function to be called when an error occurred.
571 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
573 * @privilege %http://tizen.org/privilege/recorder
574 * @param[in] callback Callback function to register
575 * @param[in] user_data The user data to be passed to the callback function
576 * @return @c 0 on success,
577 * otherwise a negative error value
578 * @retval #VC_ERROR_NONE Successful
579 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
580 * @retval #VC_ERROR_INVALID_STATE Invalid state
581 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
582 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
583 * @pre The state should be #VC_STATE_INITIALIZED.
585 * @see vc_unset_error_cb()
587 int vc_set_error_cb(vc_error_cb callback, void* user_data);
591 * @brief Unregisters the callback function.
592 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
594 * @privilege %http://tizen.org/privilege/recorder
595 * @return @c 0 on success,
596 * otherwise a negative error value
597 * @retval #VC_ERROR_NONE Successful
598 * @retval #VC_ERROR_INVALID_STATE Invalid state
599 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
600 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
601 * @pre The state should be #VC_STATE_INITIALIZED.
602 * @see vc_set_error_cb()
604 int vc_unset_error_cb(void);
609 * @brief Requests to send TTS streaming data, asynchronously.
610 * @details Using this function, the developer can request text to speech to the framework.
611 * When the developer requests the TTS with @a language, VC engine will send PCM data which is synthesized using VC engine's own persona.
612 * 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
613 * 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,
614 * 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().
615 * This function is executed asynchronously, so if there is an error while synthesizing, vc_error_cb() will be called.
618 * @privilege %http://tizen.org/privilege/voicecontrol.tts
619 * @param[in] text The text to be requested for TTS
620 * @param[in] language The language is specified as an ISO 3166 alpha-2 two-letter country code
621 * followed by ISO 639-1 for the two-letter language code.
622 * For example, "ko_KR" for Korean, "en_US" for American English
623 * @param[in] to_vc_manager The value for selection between VC client and VC manager\n
624 * If @c true, the synthesized PCM data will be delivered to the VC manager, otherwise it will be delivered to the VC client
625 * @param[out] utt_id The utterance id
626 * @return @c 0 on success,
627 * otherwise a negative error value
628 * @retval #VC_ERROR_NONE Successful
629 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
630 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
631 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
632 * @retval #VC_ERROR_INVALID_STATE Invalid state
633 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
634 * @pre The state should be #VC_STATE_READY.
635 * @see vc_tts_cancel()
637 int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id);
642 * @brief Requests to cancel TTS streaming data.
645 * @privilege %http://tizen.org/privilege/voicecontrol.tts
646 * @param[in] utt_id The utterance id
647 * @return @c 0 on success,
648 * otherwise a negative error value
649 * @retval #VC_ERROR_NONE Successful
650 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
651 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
652 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
653 * @retval #VC_ERROR_INVALID_STATE Invalid state
654 * @pre The state should be #VC_STATE_READY.
655 * @see vc_tts_request()
657 int vc_tts_cancel(int utt_id);
662 * @brief Gets the TTS audio details.
663 * @details Using this function, the developer can get details of synthesized audio data which is requested by vc_tts_request() function.
666 * @privilege %http://tizen.org/privilege/voicecontrol.tts
667 * @param[out] rate The audio sampling rate
668 * @param[out] channel The audio channel
669 * @param[out] audio_type The audio type
670 * @return @c 0 on success,
671 * otherwise a negative error value
672 * @retval #VC_ERROR_NONE Successful
673 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
674 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
675 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
676 * @retval #VC_ERROR_INVALID_STATE Invalid state
677 * @pre The state should be #VC_STATE_READY.
679 int vc_tts_get_synthesized_audio_details(int* rate, vc_audio_channel_e* channel, vc_audio_type_e* audio_type);
684 * @brief Sets the TTS streaming callback function.
687 * @privilege %http://tizen.org/privilege/voicecontrol.tts
688 * @param[in] callback The callback function
689 * @param[in] user_data The user data to be passed to the callback function
690 * @return @c 0 on success,
691 * otherwise a negative error value
692 * @retval #VC_ERROR_NONE Successful
693 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
694 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
695 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
696 * @retval #VC_ERROR_INVALID_STATE Invalid state
697 * @pre The state should be #VC_STATE_INITIALIZED.
699 int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data);
704 * @brief Unsets the TTS streaming callback function.
707 * @privilege %http://tizen.org/privilege/voicecontrol.tts
708 * @return @c 0 on success,
709 * otherwise a negative error value
710 * @retval #VC_ERROR_NONE Successful
711 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
712 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
713 * @retval #VC_ERROR_INVALID_STATE Invalid state
714 * @pre The state should be #VC_STATE_INITIALIZED.
716 int vc_tts_unset_streaming_cb(void);
721 * @brief Sets the TTS utterance status callback function.
722 * @details Using this function, the developer can set the utterance status callback to be called
723 * when the VC manager client starts or stops playing TTS PCM data which was requested to be synthesized with the vc_tts_request() function.
724 * This function is called when @a to_vc_manager in the vc_tts_request() function call is @c true.
727 * @privilege %http://tizen.org/privilege/voicecontrol.tts
728 * @param[in] callback The callback function
729 * @param[in] user_data The user data to be passed to the callback function
730 * @return @c 0 on success,
731 * otherwise a negative error value
732 * @retval #VC_ERROR_NONE Successful
733 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
734 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
735 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
736 * @retval #VC_ERROR_INVALID_STATE Invalid state
737 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
738 * @pre The state should be #VC_STATE_INITIALIZED.
740 int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data);
745 * @brief Unsets the TTS utterance status callback function.
748 * @privilege %http://tizen.org/privilege/voicecontrol.tts
749 * @return @c 0 on success,
750 * otherwise a negative error value
751 * @retval #VC_ERROR_NONE Successful
752 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
753 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
754 * @retval #VC_ERROR_INVALID_STATE Invalid state
755 * @pre The state should be #VC_STATE_INITIALIZED.
757 int vc_tts_unset_utterance_status_cb(void);
768 #endif /* __VOICE_CONTROL_H__ */