diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-03-06 23:25:25 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-03-07 12:51:36 +0000 |
commit | 207514fb2578cfac611b4ab98b251d1524a55efe (patch) | |
tree | 581cea233e7d0d5a1b0356552c1201ce1ca4bdd4 /apps/voice_thread.c | |
parent | c16f9142f7224007eeca9e44731db95af2b17a8e (diff) | |
download | rockbox-207514fb2578cfac611b4ab98b251d1524a55efe.tar.gz rockbox-207514fb2578cfac611b4ab98b251d1524a55efe.zip |
voice: Allow voice prompt volume to be configurable
It defaults to 100%, allow it to be dialed back
Change-Id: If997fb7d3057472a7fac0be4ae7d1e8fce654c49
Diffstat (limited to 'apps/voice_thread.c')
-rw-r--r-- | apps/voice_thread.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/voice_thread.c b/apps/voice_thread.c index d7c352509b..77bdd08d44 100644 --- a/apps/voice_thread.c +++ b/apps/voice_thread.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "pcm.h" | 31 | #include "pcm.h" |
32 | #include "pcm_mixer.h" | 32 | #include "pcm_mixer.h" |
33 | #include "codecs/libspeex/speex/speex.h" | 33 | #include "codecs/libspeex/speex/speex.h" |
34 | #include "settings.h" | ||
34 | 35 | ||
35 | /* Default number of PCM frames to queue - adjust as necessary per-target */ | 36 | /* Default number of PCM frames to queue - adjust as necessary per-target */ |
36 | #define VOICE_FRAMES 4 | 37 | #define VOICE_FRAMES 4 |
@@ -327,6 +328,13 @@ void voice_wait(void) | |||
327 | sleep(1); | 328 | sleep(1); |
328 | } | 329 | } |
329 | 330 | ||
331 | void voice_set_mixer_level(int percent) | ||
332 | { | ||
333 | percent *= MIX_AMP_UNITY; | ||
334 | percent /= 100; | ||
335 | mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, percent); | ||
336 | } | ||
337 | |||
330 | /* Initialize voice thread data that must be valid upon starting and the | 338 | /* Initialize voice thread data that must be valid upon starting and the |
331 | * setup the DSP parameters */ | 339 | * setup the DSP parameters */ |
332 | static void voice_data_init(struct voice_thread_data *td) | 340 | static void voice_data_init(struct voice_thread_data *td) |
@@ -337,7 +345,8 @@ static void voice_data_init(struct voice_thread_data *td) | |||
337 | dsp_configure(td->dsp, DSP_SET_SAMPLE_DEPTH, VOICE_SAMPLE_DEPTH); | 345 | dsp_configure(td->dsp, DSP_SET_SAMPLE_DEPTH, VOICE_SAMPLE_DEPTH); |
338 | dsp_configure(td->dsp, DSP_SET_STEREO_MODE, STEREO_MONO); | 346 | dsp_configure(td->dsp, DSP_SET_STEREO_MODE, STEREO_MONO); |
339 | 347 | ||
340 | mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, MIX_AMP_UNITY); | 348 | voice_set_mixer_level(global_settings.talk_mixer_amp); |
349 | |||
341 | voice_buf->td = td; | 350 | voice_buf->td = td; |
342 | td->dst = NULL; | 351 | td->dst = NULL; |
343 | } | 352 | } |