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_request_start()
236 * @see vc_request_stop()
237 * @see vc_request_cancel()
238 * @see vc_set_service_state_changed_cb()
239 * @see vc_unset_service_state_changed_cb()
241 int vc_get_service_state(vc_service_state_e* state);
245 * @brief Gets the system command list.
248 * @privilege %http://tizen.org/privilege/recorder
249 * @remarks In the system command list, there are system commands predefined by product manufacturers. Those commands have the highest priority.
250 * Therefore, the user can not set any commands same with the system commands.
251 * The @a vc_sys_cmd_list must be released using free() when it is no longer required.
252 * @param[out] vc_sys_cmd_list System command list handle
253 * @return @c 0 on success,
254 * otherwise a negative error value
255 * @retval #VC_ERROR_NONE Successful
256 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
257 * @retval #VC_ERROR_INVALID_STATE Invalid state
258 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
259 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
260 * @pre The service state should be #VC_SERVICE_STATE_READY.
261 * @see vc_unset_command_list()
263 int vc_get_system_command_list(vc_cmd_list_h* vc_sys_cmd_list);
267 * @brief Sets the invocation name.
270 * @privilege %http://tizen.org/privilege/recorder
271 * @remarks Invocation name is used to activate background commands. The invocation name can be the same as the application name or any other phrase.
272 * For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample".
273 * In order to activate the background command, users can say "Tizen Sample, Play music".
274 * 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".
275 * If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized.
276 * This function should be called before vc_set_command_list().
277 * @param[in] name Invocation name that an application wants to be invoked by
278 * @return @c 0 on success,
279 * otherwise a negative error value
280 * @retval #VC_ERROR_NONE Successful
281 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
282 * @retval #VC_ERROR_INVALID_STATE Invalid state
283 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
284 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
285 * @pre The state should be #VC_STATE_READY.
286 * @see vc_set_command_list()
288 int vc_set_invocation_name(const char* name);
292 * @brief Requests to set app id which is to want to ask the server dialogue.
293 * @details Using this function, the developer can request registering the application on vc framework.
294 * If developer requests to register @a app_id with @a credential which is valid, the application will be set on vc framework.
295 * and then, when the developer requests the dialogue using vc_request_dialog(), dialog from specific engine server will be played by vc framework.
298 * @privilege %http://tizen.org/privilege/recorder
299 * @param[in] app_id App id which is to want to ask server dialog.
300 * @param[in] credential Credential key.
301 * @return @c 0 on success,
302 * otherwise a negative error value
303 * @retval #VC_ERROR_NONE Successful
304 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
305 * @retval #VC_ERROR_INVALID_STATE Invalid state
306 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
307 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
308 * @pre The service state should be #VC_SERVICE_STATE_READY.
309 * @see vc_unset_server_dialog()
311 int vc_set_server_dialog(const char* app_id, const char* credential);
315 * @brief Requests to unset app id which is to not want to ask the server dialogue.
316 * @details Using this function, the developer can disable function to ask dialog based on server.
319 * @privilege %http://tizen.org/privilege/recorder
320 * @param[in] app_id App id which is to not want to ask server dialog.
321 * @return @c 0 on success,
322 * otherwise a negative error value
323 * @retval #VC_ERROR_NONE Successful
324 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
325 * @retval #VC_ERROR_INVALID_STATE Invalid state
326 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
327 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
328 * @pre The service state should be #VC_SERVICE_STATE_READY.
329 * @see vc_set_server_dialog()
331 int vc_unset_server_dialog(const char* app_id);
335 * @brief Requests to start the dialogue.
336 * @details Using this function, the developer can request starting the dialogue to the framework.
337 * When the developer requests the dialogue, two types of texts, @a disp_text and @a utt_text, can be sent by this function.
338 * @a disp_text is a text for displaying, and @a utt_text is that for uttering.
339 * 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.
340 * Also, the developer can set whether the dialogue starts automatically or not, using @a auto_start.
341 * If the developer sets @a auto_start as @c true, the framework will start to record next speech and continue the dialogue.
344 * @privilege %http://tizen.org/privilege/recorder
345 * @remarks If @a auto_start is @c true, the recognition will start again. In this case, it can be restarted up to 4 times.
346 * @param[in] disp_text Text to be displayed on the screen
347 * @param[in] utt_text Text to be spoken
348 * @param[in] auto_start A variable for setting whether the dialog session will be restarted automatically or not
349 * @return @c 0 on success,
350 * otherwise a negative error value
351 * @retval #VC_ERROR_NONE Successful
352 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
353 * @retval #VC_ERROR_INVALID_STATE Invalid state
354 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
355 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
356 * @pre The service state should be #VC_SERVICE_STATE_READY.
358 int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_start);
362 * @brief Sets command list.
363 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
365 * @privilege %http://tizen.org/privilege/recorder
366 * @remarks The command type is valid for #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND.
367 * The matched commands of command list should be set and they should include type and command text at least.
368 * @param[in] vc_cmd_list Command list handle
369 * @param[in] type Command type
370 * @return @c 0 on success,
371 * otherwise a negative error value
372 * @retval #VC_ERROR_NONE Successful
373 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
374 * @retval #VC_ERROR_INVALID_STATE Invalid state
375 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
376 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
377 * @pre The state should be #VC_STATE_READY.
378 * @see vc_unset_command_list()
380 int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type);
384 * @brief Unsets command list.
385 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
387 * @privilege %http://tizen.org/privilege/recorder
388 * @param[in] type Command type
389 * @return @c 0 on success,
390 * otherwise a negative error value
391 * @retval #VC_ERROR_NONE Successful
392 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
393 * @retval #VC_ERROR_INVALID_STATE Invalid state
394 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
395 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
396 * @pre The state should be #VC_STATE_READY.
397 * @see vc_set_command_list()
399 int vc_unset_command_list(int type);
403 * @brief Gets the recognition result.
406 * @privilege %http://tizen.org/privilege/recorder
407 * @param[in] callback Callback function to get recognition result
408 * @param[in] user_data The user data to be passed to the callback function
409 * @return @c 0 on success,
410 * otherwise a negative error value
411 * @retval #VC_ERROR_NONE Successful
412 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
413 * @retval #VC_ERROR_INVALID_STATE Invalid state
414 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
415 * @pre The state should be #VC_STATE_READY.
416 * @see vc_result_cb()
418 int vc_get_result(vc_result_cb callback, void* user_data);
422 * @brief Registers a callback function for getting recognition result.
423 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
425 * @privilege %http://tizen.org/privilege/recorder
426 * @param[in] callback Callback function to register
427 * @param[in] user_data The user data to be passed to the callback function
428 * @return @c 0 on success,
429 * otherwise a negative error value
430 * @retval #VC_ERROR_NONE Successful
431 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
432 * @retval #VC_ERROR_INVALID_STATE Invalid state
433 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
434 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
435 * @pre The state should be #VC_STATE_INITIALIZED.
436 * @see vc_result_cb()
437 * @see vc_unset_result_cb()
439 int vc_set_result_cb(vc_result_cb callback, void* user_data);
443 * @brief Unregisters the callback function.
444 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
446 * @privilege %http://tizen.org/privilege/recorder
447 * @return @c 0 on success,
448 * otherwise a negative error value
449 * @retval #VC_ERROR_NONE Successful
450 * @retval #VC_ERROR_INVALID_STATE Invalid state
451 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
452 * @pre The state should be #VC_STATE_INITIALIZED.
453 * @see vc_set_result_cb()
455 int vc_unset_result_cb(void);
459 * @brief Registers a callback function to be called when state is changed.
460 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
462 * @privilege %http://tizen.org/privilege/recorder
463 * @param[in] callback Callback function to register
464 * @param[in] user_data The user data to be passed to the callback function
465 * @return @c 0 on success,
466 * otherwise a negative error value
467 * @retval #VC_ERROR_NONE Successful
468 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
469 * @retval #VC_ERROR_INVALID_STATE Invalid state
470 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
471 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
472 * @pre The state should be #VC_STATE_INITIALIZED.
473 * @see vc_service_state_changed_cb()
474 * @see vc_unset_service_state_changed_cb()
476 int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data);
480 * @brief Unregisters the callback function.
481 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
483 * @privilege %http://tizen.org/privilege/recorder
484 * @return @c 0 on success,
485 * otherwise a negative error value
486 * @retval #VC_ERROR_NONE Successful
487 * @retval #VC_ERROR_INVALID_STATE Invalid state
488 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
489 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
490 * @pre The state should be #VC_STATE_INITIALIZED.
491 * @see vc_set_service_state_changed_cb()
493 int vc_unset_service_state_changed_cb(void);
497 * @brief Registers a callback function to be called when state is changed.
498 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
500 * @privilege %http://tizen.org/privilege/recorder
501 * @param[in] callback Callback function to register
502 * @param[in] user_data The user data to be passed to the callback function
503 * @return @c 0 on success,
504 * otherwise a negative error value
505 * @retval #VC_ERROR_NONE Successful
506 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
507 * @retval #VC_ERROR_INVALID_STATE Invalid state
508 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
509 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
510 * @pre The state should be #VC_STATE_INITIALIZED.
511 * @see vc_state_changed_cb()
512 * @see vc_unset_state_changed_cb()
514 int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data);
518 * @brief Unregisters the callback function.
519 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
521 * @privilege %http://tizen.org/privilege/recorder
522 * @return @c 0 on success,
523 * otherwise a negative error value
524 * @retval #VC_ERROR_NONE Successful
525 * @retval #VC_ERROR_INVALID_STATE Invalid state
526 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
527 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
528 * @pre The state should be #VC_STATE_INITIALIZED.
529 * @see vc_set_state_changed_cb()
531 int vc_unset_state_changed_cb(void);
535 * @brief Registers a callback function to be called when current language is changed.
536 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
538 * @privilege %http://tizen.org/privilege/recorder
539 * @param[in] callback Callback function to register
540 * @param[in] user_data The user data to be passed to the callback function
541 * @return @c 0 on success,
542 * otherwise a negative error value
543 * @retval #VC_ERROR_NONE Successful
544 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
545 * @retval #VC_ERROR_INVALID_STATE Invalid state
546 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
547 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
548 * @pre The state should be #VC_STATE_INITIALIZED.
549 * @see vc_current_language_changed_cb()
550 * @see vc_unset_current_language_changed_cb()
552 int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback, void* user_data);
556 * @brief Unregisters the callback function.
557 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
559 * @privilege %http://tizen.org/privilege/recorder
560 * @return @c 0 on success,
561 * otherwise a negative error value
562 * @retval #VC_ERROR_NONE Successful
563 * @retval #VC_ERROR_INVALID_STATE Invalid state
564 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
565 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
566 * @pre The state should be #VC_STATE_INITIALIZED.
567 * @see vc_set_current_language_changed_cb()
569 int vc_unset_current_language_changed_cb(void);
573 * @brief Registers a callback function to be called when an error occurred.
574 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
576 * @privilege %http://tizen.org/privilege/recorder
577 * @param[in] callback Callback function to register
578 * @param[in] user_data The user data to be passed to the callback function
579 * @return @c 0 on success,
580 * otherwise a negative error value
581 * @retval #VC_ERROR_NONE Successful
582 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
583 * @retval #VC_ERROR_INVALID_STATE Invalid state
584 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
585 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
586 * @pre The state should be #VC_STATE_INITIALIZED.
588 * @see vc_unset_error_cb()
590 int vc_set_error_cb(vc_error_cb callback, void* user_data);
594 * @brief Unregisters the callback function.
595 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
597 * @privilege %http://tizen.org/privilege/recorder
598 * @return @c 0 on success,
599 * otherwise a negative error value
600 * @retval #VC_ERROR_NONE Successful
601 * @retval #VC_ERROR_INVALID_STATE Invalid state
602 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
603 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
604 * @pre The state should be #VC_STATE_INITIALIZED.
605 * @see vc_set_error_cb()
607 int vc_unset_error_cb(void);
611 * @brief Requests to send TTS streaming data, asynchronously.
612 * @details Using this function, the developer can request text to speech to the framework.
613 * When the developer requests the TTS with @a language, VC engine will send PCM data which is synthesized using VC engine's own persona.
614 * 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
615 * 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,
616 * 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().
617 * This function is executed asynchronously, so if there is an error while synthesizing, vc_error_cb() will be called.
619 * @privlevel @partner
620 * @privilege %http://tizen.org/privilege/voicecontrol.tts
621 * @param[in] text The text to be requested for TTS
622 * @param[in] language The language is specified as an ISO 3166 alpha-2 two-letter country code
623 * followed by ISO 639-1 for the two-letter language code.
624 * For example, "ko_KR" for Korean, "en_US" for American English
625 * @param[in] to_vc_manager The value for selection between VC client and VC manager\n
626 * If @c true, the synthesized PCM data will be delivered to the VC manager, otherwise it will be delivered to the VC client
627 * @param[out] utt_id The utterance id
628 * @return @c 0 on success,
629 * otherwise a negative error value
630 * @retval #VC_ERROR_NONE Successful
631 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
632 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
633 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
634 * @retval #VC_ERROR_INVALID_STATE Invalid state
635 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
636 * @pre The state should be #VC_STATE_READY.
637 * @see vc_tts_cancel()
639 int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id);
643 * @brief Requests to cancel TTS streaming data.
645 * @privlevel @partner
646 * @privilege %http://tizen.org/privilege/voicecontrol.tts
647 * @param[in] utt_id The utterance id
648 * @return @c 0 on success,
649 * otherwise a negative error value
650 * @retval #VC_ERROR_NONE Successful
651 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
652 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
653 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
654 * @retval #VC_ERROR_INVALID_STATE Invalid state
655 * @pre The state should be #VC_STATE_READY.
656 * @see vc_tts_request()
658 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.
665 * @privlevel @partner
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);
683 * @brief Sets the TTS streaming callback function.
685 * @privlevel @partner
686 * @privilege %http://tizen.org/privilege/voicecontrol.tts
687 * @param[in] callback The callback function
688 * @param[in] user_data The user data to be passed to the callback function
689 * @return @c 0 on success,
690 * otherwise a negative error value
691 * @retval #VC_ERROR_NONE Successful
692 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
693 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
694 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
695 * @retval #VC_ERROR_INVALID_STATE Invalid state
696 * @pre The state should be #VC_STATE_INITIALIZED.
698 int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data);
702 * @brief Unsets the TTS streaming callback function.
704 * @privlevel @partner
705 * @privilege %http://tizen.org/privilege/voicecontrol.tts
706 * @return @c 0 on success,
707 * otherwise a negative error value
708 * @retval #VC_ERROR_NONE Successful
709 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
710 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
711 * @retval #VC_ERROR_INVALID_STATE Invalid state
712 * @pre The state should be #VC_STATE_INITIALIZED.
714 int vc_tts_unset_streaming_cb(void);
718 * @brief Sets the TTS utterance status callback function.
719 * @details Using this function, the developer can set the utterance status callback to be called
720 * when the VC manager client starts or stops playing TTS PCM data which was requested to be synthesized with the vc_tts_request() function.
721 * This function is called when @a to_vc_manager in the vc_tts_request() function call is true.
723 * @privlevel @partner
724 * @privilege %http://tizen.org/privilege/voicecontrol.tts
725 * @param[in] callback The callback function
726 * @param[in] user_data The user data to be passed to the callback function
727 * @return @c 0 on success,
728 * otherwise a negative error value
729 * @retval #VC_ERROR_NONE Successful
730 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
731 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
732 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
733 * @retval #VC_ERROR_INVALID_STATE Invalid state
734 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
735 * @pre The state should be #VC_STATE_INITIALIZED.
737 int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data);
741 * @brief Unsets the TTS utterance status callback function.
743 * @privlevel @partner
744 * @privilege %http://tizen.org/privilege/voicecontrol.tts
745 * @return @c 0 on success,
746 * otherwise a negative error value
747 * @retval #VC_ERROR_NONE Successful
748 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
749 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
750 * @retval #VC_ERROR_INVALID_STATE Invalid state
751 * @pre The state should be #VC_STATE_INITIALIZED.
753 int vc_tts_unset_utterance_status_cb(void);
764 #endif /* __VOICE_CONTROL_H__ */