summaryrefslogtreecommitdiffstats
path: root/apps/voice_thread.c
diff options
context:
space:
mode:
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;
}