From fb15d2963c0388cab0d35dcea7dc9cb4de9073e0 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 4 Sep 2019 20:44:49 +0900 Subject: [PATCH] [ACR-1450] Add to request vc-tts Change-Id: Ic14941e62a511140fb5e2e5ce030fa6201e47dee --- client/vc.c | 8 +- include/voice_control.h | 200 +++++++++++++++++++++++++++++++++------ include/voice_control_common.h | 52 +++++++++- include/voice_control_internal.h | 172 --------------------------------- 4 files changed, 227 insertions(+), 205 deletions(-) diff --git a/client/vc.c b/client/vc.c index d4aa48c..677713e 100644 --- a/client/vc.c +++ b/client/vc.c @@ -2994,7 +2994,7 @@ int __vc_cb_tts_streaming(int utt_id, vc_tts_event_e event, char* buffer, int le return ret; } -int vc_tts_request(const char* text, const char* language, bool to_vcm, int* utt_id) +int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id) { vc_state_e state; int ret = -1; @@ -3031,12 +3031,12 @@ int vc_tts_request(const char* text, const char* language, bool to_vcm, int* utt return VC_ERROR_INVALID_STATE; } - SLOG(LOG_DEBUG, TAG_VCC, "@@@ tts request, pid(%d), text(%s), language(%s), to_vcm(%d)", pid, text, language, to_vcm); + SLOG(LOG_DEBUG, TAG_VCC, "@@@ tts request, pid(%d), text(%s), language(%s), to_vc_manager(%d)", pid, text, language, to_vc_manager); int count = 0; bool is_prepared = false; do { - ret = vc_dbus_request_tts(pid, text, language, to_vcm, utt_id); + ret = vc_dbus_request_tts(pid, text, language, to_vc_manager, utt_id); if (0 != ret) { if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(g_vc, VC_STATE_INITIALIZED); @@ -3277,7 +3277,7 @@ int __vc_cb_utterance_status(int utt_id, int utt_status) SLOG(LOG_DEBUG, TAG_VCC, "Utterance status callback is called"); vc_client_use_callback(g_vc); - callback(utt_id, (vc_tts_utterance_status_e)utt_status); + callback(utt_id, (vc_tts_utterance_status_e)utt_status, user_data); vc_client_not_use_callback(g_vc); return 0; diff --git a/include/voice_control.h b/include/voice_control.h index f46b5c0..c37d991 100644 --- a/include/voice_control.h +++ b/include/voice_control.h @@ -86,8 +86,8 @@ extern "C" * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @remarks If the function succeeds, @a vc must be released with vc_deinitialize(). - * @return @c 0 on success, + * @remarks If the function succeeds, vc must be released with vc_deinitialize(). + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_OUT_OF_MEMORY Out of memory @@ -105,14 +105,14 @@ int vc_initialize(void); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state * @retval #VC_ERROR_OPERATION_FAILED Operation failure * @retval #VC_ERROR_PERMISSION_DENIED Permission denied * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * @see vc_deinitialize() + * @see vc_initialize() */ int vc_deinitialize(void); @@ -122,7 +122,7 @@ int vc_deinitialize(void); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -141,7 +141,7 @@ int vc_prepare(void); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -161,7 +161,7 @@ int vc_unprepare(void); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to invoke * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -182,11 +182,11 @@ int vc_foreach_supported_languages(vc_supported_language_cb callback, void* user * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @remark If the function succeeds, @a language must be released with free() by you when you no longer need it. + * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it. * @param[out] language A language is specified as an ISO 3166 alpha-2 two letter country-code * followed by ISO 639-1 for the two-letter language code. * For example, "ko_KR" for Korean, "en_US" for American English - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -207,7 +207,7 @@ int vc_get_current_language(char** language); * @privlevel public * @privilege %http://tizen.org/privilege/recorder * @param[out] state The current state - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -225,7 +225,7 @@ int vc_get_state(vc_state_e* state); * @privlevel public * @privilege %http://tizen.org/privilege/recorder * @param[out] state The current state - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -250,7 +250,7 @@ int vc_get_service_state(vc_service_state_e* state); * Therefore, the user can not set any commands same with the system commands. * The @a vc_sys_cmd_list must be released using free() when it is no longer required. * @param[out] vc_sys_cmd_list System command list handle - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -275,7 +275,7 @@ int vc_get_system_command_list(vc_cmd_list_h* vc_sys_cmd_list); * If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized. * This function should be called before vc_set_command_list(). * @param[in] name Invocation name that an application wants to be invoked by - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -346,7 +346,7 @@ int vc_unset_server_dialog(const char* app_id); * @param[in] disp_text Text to be displayed on the screen * @param[in] utt_text Text to be spoken * @param[in] auto_start A variable for setting whether the dialog session will be restarted automatically or not - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -367,7 +367,7 @@ int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_sta * The matched commands of command list should be set and they should include type and command text at least. * @param[in] vc_cmd_list Command list handle * @param[in] type Command type - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -386,7 +386,7 @@ int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type); * @privlevel public * @privilege %http://tizen.org/privilege/recorder * @param[in] type Command type - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -406,7 +406,7 @@ int vc_unset_command_list(int type); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to get recognition result * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -425,7 +425,7 @@ int vc_get_result(vc_result_cb callback, void* user_data); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -444,7 +444,7 @@ int vc_set_result_cb(vc_result_cb callback, void* user_data); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -462,7 +462,7 @@ int vc_unset_result_cb(void); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -481,7 +481,7 @@ int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -500,7 +500,7 @@ int vc_unset_service_state_changed_cb(void); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -519,7 +519,7 @@ int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -538,7 +538,7 @@ int vc_unset_state_changed_cb(void); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -557,7 +557,7 @@ int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback, * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -576,7 +576,7 @@ int vc_unset_current_language_changed_cb(void); * @privilege %http://tizen.org/privilege/recorder * @param[in] callback Callback function to register * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter @@ -595,7 +595,7 @@ int vc_set_error_cb(vc_error_cb callback, void* user_data); * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/recorder - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * @retval #VC_ERROR_NONE Successful * @retval #VC_ERROR_INVALID_STATE Invalid state @@ -607,6 +607,152 @@ int vc_set_error_cb(vc_error_cb callback, void* user_data); int vc_unset_error_cb(void); +/** + * @brief Requests to send TTS streaming data, asynchronously. + * @details Using this function, the developer can request text to speech to the framework. + * When the developer requests the TTS with @a language, VC engine will send PCM data which is synthesized using VC engine's own persona. + * 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 + * 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, + * 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(). + * This function is executed asynchronously, so if there is an error while synthesizing, vc_error_cb() will be called. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @param[in] text The text to be requested for TTS + * @param[in] language The language is specified as an ISO 3166 alpha-2 two-letter country code + * followed by ISO 639-1 for the two-letter language code. + * For example, "ko_KR" for Korean, "en_US" for American English + * @param[in] to_vc_manager The value for selection between VC client and VC manager\n + * If @c true, the synthesized PCM data will be delivered to the VC manager, otherwise it will be delivered to the VC client + * @param[out] utt_id The utterance id + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @retval #VC_ERROR_OPERATION_FAILED Operation failure + * @pre The state should be #VC_STATE_READY. + * @see vc_tts_cancel() + */ +int vc_tts_request(const char* text, const char* language, bool to_vc_manager, int* utt_id); + + +/** + * @brief Requests to cancel TTS streaming data. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @param[in] utt_id The utterance id + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @pre The state should be #VC_STATE_READY. + * @see vc_tts_request() + */ +int vc_tts_cancel(int utt_id); + + +/** + * @brief Gets the TTS audio details. + * @details Using this function, the developer can get details of synthesized audio data which is requested by vc_tts_request() function. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @param[out] rate The audio sampling rate + * @param[out] channel The audio channel + * @param[out] audio_type The audio type + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @pre The state should be #VC_STATE_READY. + */ +int vc_tts_get_synthesized_audio_details(int* rate, vc_audio_channel_e* channel, vc_audio_type_e* audio_type); + + +/** + * @brief Sets the TTS streaming callback function. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @param[in] callback The callback function + * @param[in] user_data The user data to be passed to the callback function + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @pre The state should be #VC_STATE_INITIALIZED. + */ +int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data); + + +/** + * @brief Unsets the TTS streaming callback function. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @pre The state should be #VC_STATE_INITIALIZED. + */ +int vc_tts_unset_streaming_cb(void); + + +/** + * @brief Sets the TTS utterance status callback function. + * @details Using this function, the developer can set the utterance status callback to be called + * when the VC manager client starts or stops playing TTS PCM data which was requested to be synthesized with the vc_tts_request() function. + * This function is called when @a to_vc_manager in the vc_tts_request() function call is true. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @param[in] callback The callback function + * @param[in] user_data The user data to be passed to the callback function + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @retval #VC_ERROR_OPERATION_FAILED Operation failure + * @pre The state should be #VC_STATE_INITIALIZED. + */ +int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data); + + +/** + * @brief Unsets the TTS utterance status callback function. + * @since_tizen 5.5 + * @privlevel @partner + * @privilege %http://tizen.org/privilege/voicecontrol.tts + * @return @c 0 on success, + * otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED Not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @pre The state should be #VC_STATE_INITIALIZED. + */ +int vc_tts_unset_utterance_status_cb(void); + + #ifdef __cplusplus } #endif diff --git a/include/voice_control_common.h b/include/voice_control_common.h index 4bf4ba1..136e628 100644 --- a/include/voice_control_common.h +++ b/include/voice_control_common.h @@ -103,7 +103,7 @@ typedef enum { } vc_audio_type_e; /** - * @brief Enumerations for audio channels + * @brief Enumerations for audio channels. * @since_tizen 5.0 */ typedef enum { @@ -112,7 +112,7 @@ typedef enum { } vc_audio_channel_e; /** - * @brief Enumeration for TTS feedback events + * @brief Enumeration for TTS feedback events. * @since_tizen 5.0 */ typedef enum { @@ -122,6 +122,27 @@ typedef enum { VC_FEEDBACK_EVENT_FINISH = 3 /**< Finish event */ } vc_feedback_event_e; +/** + * @brief Enumeration for requested TTS events. + * @since_tizen 5.5 + */ +typedef enum { + VC_TTS_EVENT_FAIL = -1, /**< Failed */ + VC_TTS_EVENT_START = 1, /**< Start event */ + VC_TTS_EVENT_CONTINUE = 2, /**< Continue event */ + VC_TTS_EVENT_FINISH = 3 /**< Finish event */ +} vc_tts_event_e; + +/** + * @brief Enumeration for requested TTS utterance status events. + * @since_tizen 5.5 + */ +typedef enum { + VC_TTS_UTTERANCE_NONE = -1, /**< None */ + VC_TTS_UTTERANCE_STARTED = 1, /**< Utterance started */ + VC_TTS_UTTERANCE_COMPLETED = 2, /**< Utterance completed */ + VC_TTS_UTTERANCE_CANCELED = 3 /**< Utterance canceled */ +} vc_tts_utterance_status_e; /** * @brief Called when client gets the recognition result. @@ -200,6 +221,33 @@ typedef void (*vc_service_state_changed_cb)(vc_service_state_e previous, vc_serv typedef void (*vc_error_cb)(vc_error_e reason, void *user_data); +/** + * @brief Called when the client receives TTS streaming data from the VC engine service. + * @since_tizen 5.5 + * @remarks The @a buffer must be released with free() by you when you no longer need it. + * @param[in] event The TTS event + * @param[in] buffer The TTS streaming data + * @param[in] len The length of the TTS streaming data + * @param[in] utt_id The utterance id + * @param[in] user_data The user data passed from the callback registration function + * @pre The application registers the callback function using vc_tts_set_streaming_cb(). + * @see vc_tts_set_streaming_cb() + */ +typedef void (*vc_tts_streaming_cb)(vc_tts_event_e event, char* buffer, int len, int utt_id, void *user_data); + + +/** + * @brief Called when the client receives the TTS utterance status. + * @since_tizen 5.5 + * @param[in] utt_id The utterance id + * @param[in] status The new TTS utterance status (e.g. #VC_TTS_UTTERANCE_STARTED, #VC_TTS_UTTERANCE_COMPLETED, and so on) + * @param[in] user_data The user data passed from the callback registration function + * @pre The application registers the callback function using vc_tts_set_utterance_status_cb(). + * @see vc_tts_set_utterance_status_cb() + */ +typedef void (*vc_tts_utterance_status_cb)(int utt_id, vc_tts_utterance_status_e status, void *user_data); + + #ifdef __cplusplus } #endif diff --git a/include/voice_control_internal.h b/include/voice_control_internal.h index 131c7e5..2e117b7 100644 --- a/include/voice_control_internal.h +++ b/include/voice_control_internal.h @@ -26,20 +26,6 @@ extern "C" { #endif -typedef enum { - VC_TTS_EVENT_FAIL = -1, /**< Failed */ - VC_TTS_EVENT_START = 1, /**< Start event */ - VC_TTS_EVENT_CONTINUE = 2, /**< Continue event */ - VC_TTS_EVENT_FINISH = 3 /**< Finish event */ -} vc_tts_event_e; - -typedef enum { - VC_TTS_UTTERANCE_NONE = -1, - VC_TTS_UTTERANCE_STARTED = 1, - VC_TTS_UTTERANCE_COMPLETED = 2, - VC_TTS_UTTERANCE_CANCELED = 3 -} vc_tts_utterance_status_e; - /** * @brief Called when client gets the asr recognition result from vc-daemon. @@ -58,39 +44,6 @@ typedef enum { typedef bool (*vc_asr_result_cb)(vc_result_event_e event, const char* result, void *user_data); /** - * @brief Called when client gets TTS streaming data from vc engine service. - * @since_tizen 4.0 - * - * @remarks The @a buffer must be released with free() by you when you no longer need it. - * - * @param[in] event The TTS event - * @param[in] buffer The TTS streaming data - * @param[in] len The length of the TTS streaming data - * @param[in] utt_id The utterance id - * @param[in] user_data The user data passed from the callback registration function - * - * @pre An application registers callback function using vc_tts_set_streaming_cb(). - * - * @see vc_tts_set_streaming_cb() - * @see vc_tts_unset_streaming_cb() - */ -typedef void (*vc_tts_streaming_cb)(vc_tts_event_e event, char* buffer, int len, int utt_id, void *user_data); - -/** - * @brief Called when client gets TTS utterance status. - * @since_tizen 4.0 - * - * @param[in] utt_id The utterance id - * @param[in] status The TTS utterance status (e.g. #VC_TTS_UTTERANCE_STARTED, #VC_TTS_UTTERANCE_COMPLETED, and so on) - * - * @pre An application registers callback function using vc_tts_set_utterance_status_cb(). - * - * @see vc_tts_set_utterance_status_cb() - * @see vc_tts_unset_utterance_status_cb() - */ -typedef void (*vc_tts_utterance_status_cb)(int utt_id, vc_tts_utterance_status_e status); - -/** * @brief Sets command list from file. * @since_tizen 3.0 * @privlevel public @@ -134,131 +87,6 @@ int vc_set_command_list_from_file(const char* file_path, int type); */ int vc_prepare_sync(void); -/** - * @brief Requests to send TTS streaming data. - * @since_tizen 4.0 - * - * @param[in] text The text to be requested for TTS - * @param[in] language The language for TTS - * @param[in] to_vcm A value whether the TTS request is from vc client or vc manager - * @param[in] utt_id The utterance id - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_READY. - * - * @see vc_tts_cancel() - */ -int vc_tts_request(const char* text, const char* language, bool to_vcm, int* utt_id); - -/** - * @brief Requests to cancel TTS streaming data. - * @since_tizen 4.0 - * - * @param[in] utt_id The utterance id - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_READY. - * - * @see vc_tts_request() - */ -int vc_tts_cancel(int utt_id); - -/** - * @brief Gets TTS audio format. - * @since_tizen 4.0 - * - * @param[out] rate The audio sampling rate - * @param[out] channel The audio channel - * @param[out] audio_type The audio type - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_READY. - */ -int vc_tts_get_audio_format(int* rate, vc_audio_channel_e* channel, vc_audio_type_e* audio_type); - -/** - * @brief Sets TTS streaming callback function. - * @since_tizen 4.0 - * - * @param[in] callback The callback function - * @param[in] user_data The user data to be passed to the callback function - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_INITIALIZED. - */ -int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data); - -/** - * @brief Unsets TTS streaming callback function. - * @since_tizen 4.0 - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_INITIALIZED. - */ -int vc_tts_unset_streaming_cb(void); - -/** - * @brief Sets TTS utterance status callback function. - * @since_tizen 4.0 - * - * @param[in] callback The callback function - * @param[in] user_data The user data to be passed to the callback function - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_INITIALIZED. - */ -int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data); - -/** - * @brief Unsets TTS utterance status callback function. - * @since_tizen 4.0 - * - * @return 0 on success, otherwise a negative error value - * @retval #VC_ERROR_NONE Successful - * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #VC_ERROR_INVALID_STATE Invalid state - * @retval #VC_ERROR_PERMISSION_DENIED Permission denied - * @retval #VC_ERROR_NOT_SUPPORTED Not supported - * - * @pre The state should be #VC_STATE_INITIALIZED. - */ -int vc_tts_unset_utterance_status_cb(void); - #ifdef __cplusplus } -- 2.7.4