Skip to content

Commit

Permalink
mic.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Nov 2, 2024
1 parent 8cd3e85 commit 4cbff2c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples/examples-custom-boards/lyrat-mini/mic/mic.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@

/**
* The microphone seems to be attached to 2 different i2s ports. In addition to the
* ES8311, the ES7243 is also started.
* The I2S pins can be selected via cfg.i2s_function: CODEC uses the ES8311 I2S pins
* and CODEC_ADC uses the ES7243 I2S pins; By default the CODEC value is used.
*
* Unfortunatly neither setting will give a proper microphone input!
*/

#include "AudioTools.h"
#include "AudioTools/AudioLibs/AudioBoardStream.h"

AudioInfo info(44100, 1, 16);
AudioInfo info(44100, 2, 16);
AudioBoardStream i2s(LyratMini); // Access I2S as stream
CsvOutput<int16_t> csvStream(Serial);
StreamCopy copier(csvStream, i2s); // copy i2s to csvStream

// Arduino Setup
void setup(void) {
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning);
// Display details what is going on
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
AudioDriverLogger.begin(Serial, AudioDriverLogLevel::Info);

auto cfg = i2s.defaultConfig(RX_MODE);
cfg.copyFrom(info);
Expand Down

0 comments on commit 4cbff2c

Please sign in to comment.