speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/7] move spd_audio_close from each module to the module_util.c


From: Andrei Kholodnyi
Subject: [PATCH 2/7] move spd_audio_close from each module to the module_util.c
Date: Sun, 28 Nov 2010 19:51:23 +0100

remove corresponding functions from synths.
There is no need to init audio specific for each module.

now call spd_audio_close before module_close
---
 src/modules/espeak.c       |    5 -----
 src/modules/festival.c     |    4 ----
 src/modules/flite.c        |    3 ---
 src/modules/generic.c      |    3 ---
 src/modules/ibmtts.c       |    3 ---
 src/modules/ivona.c        |    4 ----
 src/modules/module_utils.c |    4 ++++
 src/modules/pico.c         |    5 -----
 8 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/src/modules/espeak.c b/src/modules/espeak.c
index 0253648..6fc412f 100644
--- a/src/modules/espeak.c
+++ b/src/modules/espeak.c
@@ -479,11 +479,6 @@ module_close(void)
        DBG("Espeak: terminating synthesis.");
        espeak_Terminate();
 
-       DBG("Espeak: Closing audio output");
-       if (module_audio_id) {
-               spd_audio_close(module_audio_id);
-       }
-
        DBG("Freeing resources.");
        espeak_clear_playback_queue();
        espeak_free_voice_list();
diff --git a/src/modules/festival.c b/src/modules/festival.c
index 80bdeb8..5b78a34 100644
--- a/src/modules/festival.c
+++ b/src/modules/festival.c
@@ -472,10 +472,6 @@ module_close(void)
     //    DBG("Removing junk files in tmp/");
     //    system("rm -f /tmp/est* 2> /dev/null");
 
-    DBG("Closing audio output");
-    if (module_audio_id)
-       spd_audio_close(module_audio_id);
-
     return 0;
 }
 
diff --git a/src/modules/flite.c b/src/modules/flite.c
index f196cff..72528bb 100644
--- a/src/modules/flite.c
+++ b/src/modules/flite.c
@@ -237,9 +237,6 @@ module_close(void)
 
     g_free(flite_voice);
 
-    DBG("Closing audio output");
-    spd_audio_close(module_audio_id);
-
     return 0;
 }
 
diff --git a/src/modules/generic.c b/src/modules/generic.c
index 0a3f7a8..42477b3 100644
--- a/src/modules/generic.c
+++ b/src/modules/generic.c
@@ -280,9 +280,6 @@ module_close(void)
     if (module_terminate_thread(generic_speak_thread) != 0)
         return -1;
 
-    if (module_audio_id)
-        spd_audio_close(module_audio_id);
-
     return 0;
 }
 
diff --git a/src/modules/ibmtts.c b/src/modules/ibmtts.c
index 5041d86..18bc67c 100644
--- a/src/modules/ibmtts.c
+++ b/src/modules/ibmtts.c
@@ -669,9 +669,6 @@ module_close(void)
     /* Free buffer for ECI audio. */
     g_free(audio_chunk);
 
-    DBG("Ibmtts: Closing audio output");
-    spd_audio_close(module_audio_id);
-
     /* Request each thread exit and wait until it exits. */
     DBG("Ibmtts: Terminating threads");
     ibmtts_thread_exit_requested = IBMTTS_TRUE;
diff --git a/src/modules/ivona.c b/src/modules/ivona.c
index 722bd39..6336801 100644
--- a/src/modules/ivona.c
+++ b/src/modules/ivona.c
@@ -258,10 +258,6 @@ module_close(void)
     if (module_terminate_thread(ivona_speak_thread) != 0)
         return -1;
 
-
-    DBG("Closing audio output");
-    spd_audio_close(module_audio_id);
-
     return 0;
 }
 
diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index 652b123..7afc83e 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -453,6 +453,10 @@ do_quit(void)
 {
     printf("210 OK QUIT\n");    
     fflush(stdout);
+
+    spd_audio_close(module_audio_id);
+    module_audio_id = NULL;
+
     module_close();
     return;
 }
diff --git a/src/modules/pico.c b/src/modules/pico.c
index b3b4cbf..020b898 100644
--- a/src/modules/pico.c
+++ b/src/modules/pico.c
@@ -613,11 +613,6 @@ int module_close(void)
                picoSystem = NULL;
        }
 
-       if (module_audio_id) {
-               spd_audio_close(module_audio_id);
-       }
-       module_audio_id = NULL;
-
        g_free(pico_idle_semaphore);
        g_free(pico_play_semaphore);
        pico_idle_semaphore = NULL;
-- 
1.6.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]