summaryrefslogtreecommitdiff
path: root/apps/voice_thread.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-03-06 23:25:25 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-03-07 12:51:36 +0000
commit207514fb2578cfac611b4ab98b251d1524a55efe (patch)
tree581cea233e7d0d5a1b0356552c1201ce1ca4bdd4 /apps/voice_thread.c
parentc16f9142f7224007eeca9e44731db95af2b17a8e (diff)
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.c11
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 @@
#include "pcm.h"
#include "pcm_mixer.h"
#include "codecs/libspeex/speex/speex.h"
+#include "settings.h"
/* Default number of PCM frames to queue - adjust as necessary per-target */
#define VOICE_FRAMES 4
@@ -327,6 +328,13 @@ void voice_wait(void)
sleep(1);
}
+void voice_set_mixer_level(int percent)
+{
+ percent *= MIX_AMP_UNITY;
+ percent /= 100;
+ mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, percent);
+}
+
/* Initialize voice thread data that must be valid upon starting and the
* setup the DSP parameters */
static void voice_data_init(struct voice_thread_data *td)
@@ -337,7 +345,8 @@ static void voice_data_init(struct voice_thread_data *td)
dsp_configure(td->dsp, DSP_SET_SAMPLE_DEPTH, VOICE_SAMPLE_DEPTH);
dsp_configure(td->dsp, DSP_SET_STEREO_MODE, STEREO_MONO);
- mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, MIX_AMP_UNITY);
+ voice_set_mixer_level(global_settings.talk_mixer_amp);
+
voice_buf->td = td;
td->dst = NULL;
}