speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Fix default volume for pico module


From: Boris Dusek
Subject: [PATCH] Fix default volume for pico module
Date: Mon, 14 Feb 2011 21:12:59 +0100

The contract for volume currently specifies that value +100 is for the
default synthesizer volume. However the pico module used +100 for the
maximum output volume. This resulted in the necessity for the user to
configure the volume for pico module first to lower value, thus
hindering the out-of-the-box experience.
---
 src/modules/pico.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/modules/pico.c b/src/modules/pico.c
index ba062f8..2e72e12 100644
--- a/src/modules/pico.c
+++ b/src/modules/pico.c
@@ -135,14 +135,9 @@ static int pico_set_volume(signed int value)
 {
        int volume;
 
-       if (value < 0)
-               volume = PICO_VOICE_VOLUME_MIN + (value - (-100))
-                   * (PICO_VOICE_VOLUME_DEFAULT - PICO_VOICE_VOLUME_MIN)
-                   / (0 - (-100));
-       else
-               volume = PICO_VOICE_VOLUME_DEFAULT + (value - 0)
-                   * (PICO_VOICE_VOLUME_MAX - PICO_VOICE_VOLUME_DEFAULT)
-                   / (100 - 0);
+       volume = PICO_VOICE_VOLUME_MIN + (value - (-100))
+           * (PICO_VOICE_VOLUME_DEFAULT - PICO_VOICE_VOLUME_MIN)
+           / (100 - (-100));
 
        return volume;
 }
-- 
1.7.4




reply via email to

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