From: wn.jang Date: Fri, 14 Jul 2023 10:11:36 +0000 (+0900) Subject: Fix descriptions according to checking header tools X-Git-Tag: accepted/tizen/unified/20230726.020659~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F295845%2F2;p=platform%2Fcore%2Fuifw%2Ftts.git Fix descriptions according to checking header tools Change-Id: I255cd2ce425fc0eac994996302da672f7ce479c9 --- diff --git a/include/tts.h b/include/tts.h index eaaea6d..95430ae 100644 --- a/include/tts.h +++ b/include/tts.h @@ -99,6 +99,38 @@ typedef enum { /** + * @brief Enumeration for playing mode of TTS. + * @since_tizen 8.0 +*/ +typedef enum { + TTS_PLAYING_MODE_BY_SERVICE = 0, /**< Mode for TTS playing on TTS service */ + TTS_PLAYING_MODE_BY_CLIENT = 1, /**< Mode for TTS playing on TTS client */ +} tts_playing_mode_e; + + +/** + * @brief Enumeration for audio type. + * @since_tizen 8.0 + */ +typedef enum { + TTS_AUDIO_TYPE_RAW_S16 = 0, /**< Signed 16-bit audio type */ + TTS_AUDIO_TYPE_RAW_U8 /**< Unsigned 8-bit audio type */ +} tts_audio_type_e; + + +/** + * @brief Enumeration for synthesized pcm event. + * @since_tizen 8.0 +*/ +typedef enum { + TTS_SYNTHESIZED_PCM_EVENT_FAIL = -1, /**< Event when the synthesized PCM is failed */ + TTS_SYNTHESIZED_PCM_EVENT_START = 1, /**< Event when the synthesized PCM is received at first */ + TTS_SYNTHESIZED_PCM_EVENT_CONTINUE = 2, /**< Event when the synthesized PCM is received, not first and not last */ + TTS_SYNTHESIZED_PCM_EVENT_FINISH = 3 /**< Event when the synthesized PCM is received finally */ +} tts_synthesized_pcm_event_e; + + +/** * @brief Definition for automatic speaking speed. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ @@ -142,9 +174,9 @@ typedef struct tts_s *tts_h; /** * @brief Called when the state of TTS is changed. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @details If the daemon must stop player because of changing engine and * the daemon must pause player because of other requests, this callback function is called. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] tts The TTS handle * @param[in] previous The previous state * @param[in] current The current state @@ -272,6 +304,25 @@ typedef void (*tts_service_state_changed_cb)(tts_h tts, tts_service_state_e prev /** + * @brief Called when the synthesized pcm data is come from the engine. + * @since_tizen 8.0 + * @remarks The @a tts handle should not be destroyed in the callback. + * @param[in] tts The TTS handle, the same handle for which the callback was set. + * @param[in] utt_id The utterance ID + * @param[in] event The event type + * @param[in] pcm_data The synthesized pcm data. The @a pcm_data can be used only in the callback. To use outside, make a copy. + * @param[in] pcm_data_size The size of the pcm data + * @param[in] audio_type The audio type of pcm data + * @param[in] sample_rate The sampling rate of pcm data + * @param[in] user_data The user data passed from the callback registration function + * @pre An application registers this callback using tts_set_synthesized_pcm_cb() to get pcm data. + * @see tts_set_synthesized_pcm_cb() + * @see tts_unset_synthesized_pcm_cb() + */ +typedef void (*tts_synthesized_pcm_cb)(tts_h tts, int utt_id, tts_synthesized_pcm_event_e event, const char* pcm_data, int pcm_data_size, tts_audio_type_e audio_type, int sample_rate, void *user_data); + + +/** * @brief Creates a handle for TTS. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks If the function succeeds, @a tts handle must be released with tts_destroy(). @@ -459,7 +510,7 @@ int tts_get_default_voice(tts_h tts, char** language, int* voice_type); * @details The private data is the setting parameter for applying keys provided by the engine. * Using this API, the application can set the private data and use the corresponding key of the engine. * For example, if the engine provides 'girl's voice' as a voice type, the application can set the private data as the following. - * int ret = tts_set_private_data(tts_h, "voice_type", "GIRL"); + * int ret = tts_set_private_data(#tts_h, "voice_type", "GIRL"); * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif * @remarks If the engine is replaced with the other engine, the key may be ignored. * @param[in] tts The TTS handle @@ -983,6 +1034,7 @@ int tts_set_screen_reader_changed_cb(tts_h tts, tts_screen_reader_changed_cb cal */ int tts_unset_screen_reader_changed_cb(tts_h tts); + /** * @brief Sets a callback function to be called when the TTS service state changes. * @since_tizen 7.0 @@ -1001,6 +1053,7 @@ int tts_unset_screen_reader_changed_cb(tts_h tts); */ int tts_set_service_state_changed_cb(tts_h tts, tts_service_state_changed_cb callback, void* user_data); + /** * @brief Unsets the callback function. * @since_tizen 7.0 @@ -1016,6 +1069,60 @@ int tts_set_service_state_changed_cb(tts_h tts, tts_service_state_changed_cb cal */ int tts_unset_service_state_changed_cb(tts_h tts); + +/** + * @brief Sets the TTS playing mode. + * @since_tizen 8.0 + * @param[in] tts The TTS handle + * @param[in] mode The mode + * @return @c 0 on success, + * otherwise a negative error value + * @retval #TTS_ERROR_NONE Successful + * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported + * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TTS_ERROR_INVALID_STATE Invalid state + * @pre The state should be #TTS_STATE_CREATED. + * @see tts_get_playing_mode() + * @see tts_play() + */ +int tts_set_playing_mode(tts_h tts, tts_playing_mode_e mode); + + +/** + * @brief Sets the callback function to receive the synthesized pcm data from the tts service. + * @since_tizen 8.0 + * @param[in] tts The TTS handle + * @param[in] callback The callback function to register + * @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 #TTS_ERROR_NONE Successful + * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported + * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TTS_ERROR_INVALID_STATE Invalid state + * @pre The TTS state should be #TTS_STATE_CREATED. + * @see tts_synthesized_pcm_cb() + * @see tts_unset_synthesized_pcm_cb() + */ +int tts_set_synthesized_pcm_cb(tts_h tts, tts_synthesized_pcm_cb callback, void* user_data); + + +/** + * @brief Unsets the callback function to receive synthesized PCM data from the tts service. + * @since_tizen 8.0 + * @param[in] tts The TTS handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #TTS_ERROR_NONE Successful + * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported + * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TTS_ERROR_INVALID_STATE Invalid state + * @pre The TTS state should be #TTS_STATE_CREATED. + * @see tts_set_synthesized_pcm_cb() + */ +int tts_unset_synthesized_pcm_cb(tts_h tts); + + #ifdef __cplusplus } #endif diff --git a/include/tts_internal.h b/include/tts_internal.h index 070996a..11850c3 100644 --- a/include/tts_internal.h +++ b/include/tts_internal.h @@ -29,63 +29,12 @@ extern "C" /** - * @brief Enumration for playing mode of TTS. - * @since_tizen 8.0 -*/ -typedef enum { - TTS_PLAYING_MODE_BY_SERVICE = 0, /**< Mode for TTS playing on TTS service */ - TTS_PLAYING_MODE_BY_CLIENT = 1, /**< Mode for TTS playing on TTS client */ -} tts_playing_mode_e; - - -/** - * @brief Enumration for audio type. - * @since_tizen 8.0 - */ -typedef enum { - TTS_AUDIO_TYPE_RAW_S16 = 0, /**< Signed 16-bit audio type */ - TTS_AUDIO_TYPE_RAW_U8 /**< Unsigned 8-bit audio type */ -} tts_audio_type_e; - - -/** - * @brief Enumeration for synthesized pcm event. - * @since_tizen 8.0 -*/ -typedef enum { - TTS_SYNTHESIZED_PCM_EVENT_FAIL = -1, /**< Event when the synthesized PCM is failed */ - TTS_SYNTHESIZED_PCM_EVENT_START = 1, /**< Event when the synthesized PCM is received at first */ - TTS_SYNTHESIZED_PCM_EVENT_CONTINUE = 2, /**< Event when the synthesized PCM is received, not first and not last */ - TTS_SYNTHESIZED_PCM_EVENT_FINISH = 3 /**< Event when the synthesized PCM is received finally */ -} tts_synthesized_pcm_event_e; - - -/** * @brief Definition for TTS interrupt mode */ #define TTS_MODE_INTERRUPT 3 /** - * @brief Called when the synthesized pcm data is come from the engine. - * @since_tizen 8.0 - * @remarks The @a tts handle should not be destroyed in the callback. - * @param[in] tts The TTS handle, the same handle for which the callback was set. - * @param[in] utt_id The utterance ID - * @param[in] event The event type - * @param[in] pcm_data The synthesized pcm data - * @param[in] pcm_data_size The size of the pcm data - * @param[in] audio_type The audio type of pcm data - * @param[in] sample_rate The sampling rate of pcm data - * @param[in] user_data The user data passed from the callback registration function - * @pre An application registers this callback using tts_set_synthesized_pcm_cb() to get pcm data. - * @see tts_set_synthesized_pcm_cb() - * @see tts_unset_synthesized_pcm_cb() - */ -typedef void (*tts_synthesized_pcm_cb)(tts_h tts, int utt_id, tts_synthesized_pcm_event_e event, const char* pcm_data, int pcm_data_size, tts_audio_type_e audio_type, int sample_rate, void *user_data); - - -/** * @brief Sets server tts. * @details Using this API, the application can ask server tts with a credential. * The credential is a key to verify the authorization about using the engine based on server, not embedded engine. @@ -174,60 +123,6 @@ int tts_play_pcm(tts_h tts); int tts_stop_pcm(tts_h tts); -/** - * @brief Sets the TTS playing mode. - * @since_tizen 8.0 - * @param[in] tts The TTS handle - * @param[in] mode The mode - * @return @c 0 on success, - * otherwise a negative error value - * @retval #TTS_ERROR_NONE Successful - * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported - * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TTS_ERROR_INVALID_STATE Invalid state - * @pre The state should be #TTS_STATE_CREATED. - * @see tts_get_playing_mode() - * @see tts_play() - */ -int tts_set_playing_mode(tts_h tts, tts_playing_mode_e mode); - - -/** - * @brief Sets the default to be called when the synthesized pcm data is recieved. - * @since_tizen 8.0 - * @param[in] tts The TTS handle - * @param callback The callback function to register - * @param user_data The user data to be passed to the callback function - * @return @c 0 on success, - * otherwise a negative error value - * @retval #TTS_ERROR_NONE Successful - * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported - * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TTS_ERROR_INVALID_STATE Invalid state - * @pre The TTS state should be #TTS_STATE_CREATED. - * @see tts_synthesized_pcm_cb() - * @see tts_unset_synthesized_pcm_cb() - */ -int tts_set_synthesized_pcm_cb(tts_h tts, tts_synthesized_pcm_cb callback, void* user_data); - - -/** - * @brief Unsets the callback function. - * @since_tizen 8.0 - * @param tts The TTS handle - * @return @c 0 on success, - * otherwise a negative error value - * @retval #TTS_ERROR_NONE Successful - * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported - * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TTS_ERROR_INVALID_STATE Invalid state - * @pre The TTS state should be #TTS_STATE_CREATED. - * @see tts_set_synthesized_pcm_cb() - */ -int tts_unset_synthesized_pcm_cb(tts_h tts); - - - #ifdef __cplusplus } #endif