snapshot
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
|
||||
# Stream I2S Input to CSV Output
|
||||
|
||||
## General Description:
|
||||
|
||||
We implement a I2S source: We stream the sound input which we read in from the I2S interface and displays it on the Arduino Serial Plotter.
|
||||
|
||||
We use only 16bits!
|
||||
|
||||
## Pins
|
||||
|
||||
|
||||
| i2s-device | ESP32
|
||||
| -----------| ---------------
|
||||
| BCK | BCK (GPIO14)
|
||||
| WS | WS (GPIO15)
|
||||
| DATA | IN (GPIO32)
|
||||
| GND | GND
|
||||
| VCC | VIN 5V
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @file streams-i2s-serial_16bit.ino
|
||||
* @author Phil Schatzmann
|
||||
* @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-stream/streams-i2s-serial_16bit/README.md
|
||||
*
|
||||
* @author Phil Schatzmann
|
||||
* @copyright GPLv3
|
||||
*/
|
||||
|
||||
|
||||
#include "AudioTools.h"
|
||||
|
||||
AudioInfo info(44100, 2, 16);
|
||||
I2SStream i2sStream; // Access I2S as stream
|
||||
CsvOutput<int16_t> csvOutput(Serial);
|
||||
StreamCopy copier(csvOutput, i2sStream); // copy i2sStream to csvOutput
|
||||
|
||||
// Arduino Setup
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
|
||||
|
||||
auto cfg = i2sStream.defaultConfig(RX_MODE);
|
||||
cfg.copyFrom(info);
|
||||
cfg.i2s_format = I2S_STD_FORMAT; // or try with I2S_LSB_FORMAT
|
||||
cfg.is_master = true;
|
||||
// this module nees a master clock if the ESP32 is master
|
||||
cfg.use_apll = false; // try with yes
|
||||
//cfg.pin_mck = 3;
|
||||
i2sStream.begin(cfg);
|
||||
|
||||
// make sure that we have the correct channels set up
|
||||
csvOutput.begin(info);
|
||||
|
||||
}
|
||||
|
||||
// Arduino loop - copy data
|
||||
void loop() {
|
||||
copier.copy();
|
||||
}
|
||||
Reference in New Issue
Block a user