From c8564f1ca8287eba9220df191d13c949bb49c8ce Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 12 Dec 2017 20:14:34 -0500 Subject: Get voice event out of playback.c Purpose: A step in removing all voice references from playback code and prelude to other changes. Change-Id: Ic3ad7f7a33b979693e18a3456ced37eb1d2281a4 --- apps/audio_thread.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apps/audio_thread.c') diff --git a/apps/audio_thread.c b/apps/audio_thread.c index 3af8b2bbf6..74f18454cc 100644 --- a/apps/audio_thread.c +++ b/apps/audio_thread.c @@ -27,6 +27,8 @@ #include "usb.h" #include "pcm.h" #include "sound.h" +#include "pcmbuf.h" +#include "appevents.h" #include "audio_thread.h" #ifdef AUDIO_HAVE_RECORDING #include "pcm_record.h" @@ -108,6 +110,13 @@ static void NORETURN_ATTR audio_thread(void) } } +void audio_voice_event(unsigned short id, void *data) +{ + (void)id; + /* Make audio play softly while voice is speaking */ + pcmbuf_soft_mode(*(bool *)data); +} + void audio_queue_post(long id, intptr_t data) { queue_post(&audio_queue, id, data); @@ -170,6 +179,8 @@ void INIT_ATTR audio_init(void) recording_init(); #endif + add_event(VOICE_EVENT_IS_PLAYING, audio_voice_event); + /* Probably safe to say */ audio_is_initialized = true; -- cgit v1.2.3