Ejemplo n.º 1
0
ESPEAK_API espeak_ERROR espeak_Terminate(void)
{//===========================================
	ENTER("espeak_Terminate");
#ifdef USE_ASYNC
	fifo_stop();
	fifo_terminate();
	event_terminate();

	if(my_mode == AUDIO_OUTPUT_PLAYBACK)
	{
		wave_close(my_audio);
		wave_terminate();
		out_samplerate = 0;
	}

#endif
	Free(event_list);
	event_list = NULL;
	Free(outbuf);
	outbuf = NULL;
	FreePhData();
	FreeVoiceList();

	if(f_logespeak)
	{
		fclose(f_logespeak);
		f_logespeak = NULL;
	}

	return EE_OK;
}   //  end of espeak_Terminate
Ejemplo n.º 2
0
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_Terminate(void)
{
#ifdef USE_ASYNC
	fifo_stop();
	fifo_terminate();
	event_terminate();
#endif

	if ((my_mode & ENOUTPUT_MODE_SPEAK_AUDIO) == ENOUTPUT_MODE_SPEAK_AUDIO) {
#ifdef HAVE_PCAUDIOLIB_AUDIO_H
		audio_object_close(my_audio);
		audio_object_destroy(my_audio);
		my_audio = NULL;
#endif
		out_samplerate = 0;
	}

	free(event_list);
	event_list = NULL;

	free(outbuf);
	outbuf = NULL;

	FreePhData();
	FreeVoiceList();

	DeleteTranslator(translator);
	translator = NULL;

	if (p_decoder != NULL) {
		destroy_text_decoder(p_decoder);
		p_decoder = NULL;
	}

	return ENS_OK;
}