RETVM_IF(false == tts_core_check_screen_reader(client), TTS_ERROR_SCREEN_READER_OFF, "[ERROR] Screen reader option is not available");
RETVM_IF(false == tts_core_check_credential(client), TTS_ERROR_PERMISSION_DENIED, "[ERROR] Do not have app credential for this engine");
- if (duration_in_msec < 0) {
+ if (duration_in_msec <= 0) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to add silent. The duration of silent should be above than zero.");
return TTS_ERROR_INVALID_PARAMETER;
}
mState(AUDIO_STATE_NONE)
{
createSoundStreamInfo();
- createAudioHandle(mAudioType, mAudioRate);
+ int ret = createAudioHandle(mAudioType, mAudioRate);
+ if (TTSD_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, tts_tag(), "[AudioStream] Fail to create the audio handle. ret(%s)", get_error_message(ret));
+ }
}
AudioStream::~AudioStream()
__stop_and_send_ready_state(uid);
ttsd_data_destroy_speak_data(speak_data);
speak_data = NULL;
+ free(credential);
+ credential = NULL;
return;
}
sound_data_s* sound_data_start = ttsd_data_create_sound_data(g_utt.uttid, data, bytes, TTSE_RESULT_EVENT_START, audio_type, sample_rate, 0);
if (NULL == sound_data_start) {
SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Out of memory");
+ free(data);
+ data = NULL;
return false;
}
+ free(data);
+ data = NULL;
+
if (0 != ttsd_data_add_sound_data(g_utt.uid, sound_data_start)) {
SECURE_SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Fail to add sound data : uid(%u)", g_utt.uid);
ttsd_data_destroy_sound_data(sound_data_start);