summaryrefslogtreecommitdiff
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 @@
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
331void 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 */
332static void voice_data_init(struct voice_thread_data *td) 340static 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}