+int ttsd_data_clear_speak_data(int uid, speak_data_s** speak_data)
+{
+ pthread_mutex_lock(&g_speak_data_mutex);
+
+ int index = 0;
+ index = ttsd_data_is_client(uid);
+ if (index >= 0) {
+ if (NULL != *speak_data) {
+ SLOG(LOG_DEBUG, tts_tag(), "[DEBUG] utt(%d), text(%s), lang(%s), vctype(%d) speed(%d)",
+ (*speak_data)->utt_id, (*speak_data)->text, (*speak_data)->lang, (*speak_data)->vctype, (*speak_data)->speed);
+
+ if (NULL != (*speak_data)->text) {
+ free((*speak_data)->text);
+ (*speak_data)->text = NULL;
+ }
+ if (NULL != (*speak_data)->lang) {
+ free((*speak_data)->lang);
+ (*speak_data)->lang = NULL;
+ }
+
+ free(*speak_data);
+ *speak_data = NULL;
+ }
+ }
+
+ pthread_mutex_unlock(&g_speak_data_mutex);
+
+ return TTSD_ERROR_NONE;
+}
+
+int ttsd_data_clear_sound_data(int uid, sound_data_s** sound_data)
+{
+ pthread_mutex_lock(&g_sound_data_mutex);
+
+ int index = 0;
+ index = ttsd_data_is_client(uid);
+ if (index >= 0) {
+ if (NULL != *sound_data) {
+ SLOG(LOG_ERROR, tts_tag(), "[DEBUG][%p] event(%d) data(%p) size(%d) rate(%d) utt(%d)",
+ (*sound_data), (*sound_data)->event, (*sound_data)->data, (*sound_data)->data_size, (*sound_data)->rate, (*sound_data)->utt_id);
+
+ if (NULL != (*sound_data)->data) {
+ free((*sound_data)->data);
+ (*sound_data)->data = NULL;
+ }
+
+ free(*sound_data);
+ *sound_data = NULL;
+ }
+ }
+ pthread_mutex_unlock(&g_sound_data_mutex);
+
+ return TTSD_ERROR_NONE;
+}
+