From 8a58c7e5ceae9f3277d2bfe3b32beefca36afbcd Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Mon, 25 Sep 2023 11:27:41 +0200 Subject: [PATCH] setup audiokit before SD --- .../streams-audiokit-sd-audiokit.ino | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/examples-audiokit/streams-audiokit-sd-audiokit/streams-audiokit-sd-audiokit.ino b/examples/examples-audiokit/streams-audiokit-sd-audiokit/streams-audiokit-sd-audiokit.ino index e0054c496b..97dea3364e 100644 --- a/examples/examples-audiokit/streams-audiokit-sd-audiokit/streams-audiokit-sd-audiokit.ino +++ b/examples/examples-audiokit/streams-audiokit-sd-audiokit/streams-audiokit-sd-audiokit.ino @@ -46,6 +46,14 @@ void setup(){ while(!Serial); // wait for serial to be ready AudioLogger::instance().begin(Serial, AudioLogger::Warning); + // setup input and output: setup audiokit before SD! + auto cfg = kit.defaultConfig(RXTX_MODE); + cfg.sd_active = true; + cfg.copyFrom(info); + cfg.input_device = AUDIO_HAL_ADC_INPUT_LINE2; + kit.begin(cfg); + kit.setVolume(1.0); + // Open SD drive if (!SD.begin(PIN_AUDIO_KIT_SD_CARD_CS)) { Serial.println("Initialization failed!"); @@ -53,13 +61,6 @@ void setup(){ } Serial.println("Initialization done."); - // setup input and output - auto cfg = kit.defaultConfig(RXTX_MODE); - cfg.sd_active = true; - cfg.copyFrom(info); - cfg.input_device = AUDIO_HAL_ADC_INPUT_LINE2; - kit.begin(cfg); - kit.setVolume(1.0); // record when key 1 is pressed kit.audioActions().add(PIN_KEY1, record_start, record_end);