speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 4/7] move spd_audio_set_volume to main


From: Andrei Kholodnyi
Subject: [PATCH 4/7] move spd_audio_set_volume to main
Date: Sun, 28 Nov 2010 19:51:25 +0100

set spd_audio_set_volume before module_speak
---
 src/modules/espeak.c       |    2 --
 src/modules/festival.c     |    2 --
 src/modules/flite.c        |    5 -----
 src/modules/ibmtts.c       |    2 --
 src/modules/ivona.c        |    2 --
 src/modules/module_utils.c |    6 ++++++
 src/modules/pico.c         |    5 -----
 7 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/src/modules/espeak.c b/src/modules/espeak.c
index 9dd7b9f..4bb1be9 100644
--- a/src/modules/espeak.c
+++ b/src/modules/espeak.c
@@ -1001,8 +1001,6 @@ espeak_send_to_audio(TPlaybackQueueEntry 
*playback_queue_entry)
        track.samples = playback_queue_entry->data.audio.audio_chunk;
 
        DBG("Espeak: Sending %i samples to audio.", track.num_samples);
-       /* Volume is controlled by the synthesizer.  Always play at normal on 
audio device. */
-       spd_audio_set_volume(module_audio_id, 85);
        ret = spd_audio_play(module_audio_id, track, SPD_AUDIO_LE);
        if (ret < 0) {
                DBG("ERROR: Can't play track for unknown reason.");
diff --git a/src/modules/festival.c b/src/modules/festival.c
index 9a5ca14..c9c7035 100644
--- a/src/modules/festival.c
+++ b/src/modules/festival.c
@@ -608,8 +608,6 @@ _festival_speak(void* nothing)
         sem_wait(festival_semaphore);
         DBG("Semaphore on, speaking\n");
 
-       spd_audio_set_volume(module_audio_id, festival_volume);
-
        festival_stop = 0;      
        festival_speaking = 1;
        wave_cached = 0;
diff --git a/src/modules/flite.c b/src/modules/flite.c
index a2d9f87..07762ab 100644
--- a/src/modules/flite.c
+++ b/src/modules/flite.c
@@ -278,11 +278,6 @@ _flite_speak(void* nothing)
        flite_stop = 0;
        flite_speaking = 1;
 
-       if (spd_audio_set_volume(module_audio_id, flite_volume) < 0) {
-           DBG("Can't set volume. audio not initialized?\n");
-           continue;
-       }
-
        /* TODO: free(buf) */
        buf = (char*) g_malloc((FliteMaxChunkLength+1) * sizeof(char));
        pos = 0;
diff --git a/src/modules/ibmtts.c b/src/modules/ibmtts.c
index 8866195..c560f4f 100644
--- a/src/modules/ibmtts.c
+++ b/src/modules/ibmtts.c
@@ -1394,8 +1394,6 @@ ibmtts_send_to_audio(TPlaybackQueueEntry 
*playback_queue_entry)
 
     if (track.samples != NULL){
         DBG("Ibmtts: Sending %i samples to audio.", track.num_samples);
-        /* Volume is controlled by the synthesizer.  Always play at normal on 
audio device. */
-        spd_audio_set_volume(module_audio_id, 75);
         int ret = spd_audio_play(module_audio_id, track, SPD_AUDIO_LE);
         if (ret < 0) {
             DBG("ERROR: Can't play track for unknown reason.");
diff --git a/src/modules/ivona.c b/src/modules/ivona.c
index f08b86c..6baf687 100644
--- a/src/modules/ivona.c
+++ b/src/modules/ivona.c
@@ -429,8 +429,6 @@ _ivona_speak(void* nothing)
        ivona_stop = 0;
        ivona_speaking = 1;
 
-       spd_audio_set_volume(module_audio_id, ivona_volume);
-
        module_report_event_begin();
        msg=*ivona_message;
        DBG("To say: %s\n",msg);
diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index 7afc83e..a39a85b 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -93,6 +93,12 @@ do_message(SPDMessageType msgtype)
         /* force to set voice again, since synthesis_voice changed to NULL */
        msg_settings_old.voice_type = -1;
     }
+
+    /* Volume is controlled by the synthesizer. Always play at normal on audio 
device. */
+    if (spd_audio_set_volume(module_audio_id, 85) < 0) {
+        DBG("Can't set volume. audio not initialized?");
+    }
+
     ret = module_speak(msg->str, strlen(msg->str), msgtype);
 
     g_string_free(msg,1);
diff --git a/src/modules/pico.c b/src/modules/pico.c
index a7430fd..983e001 100644
--- a/src/modules/pico.c
+++ b/src/modules/pico.c
@@ -210,11 +210,6 @@ static int pico_process_tts(void)
                                DBG(MODULE_NAME
                                        ": Sending %i samples to audio.", 
track.num_samples);
 
-                               if (spd_audio_set_volume(module_audio_id, 85) < 
0) {
-                                       DBG(MODULE_NAME
-                                               "Can't set volume. audio not 
initialized?");
-                                       continue;
-                               }
                                if (spd_audio_play(module_audio_id, track,
                                                       module_audio_id->format) 
< 0) {
                                        DBG(MODULE_NAME
-- 
1.6.0.4




reply via email to

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