Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masuidrive/408e1991912f5166bbecef0860b68a9c to your computer and use it in GitHub Desktop.
Save masuidrive/408e1991912f5166bbecef0860b68a9c to your computer and use it in GitHub Desktop.
Arduino audio-tools settings for M5Stack Core2
// https://github.com/pschatzmann/arduino-audio-tools/ settings for M5Stack Core2
// Audio settings
const int sample_rate = 44100;
const int channels = 1;
// Speaker settings
I2SStream out;
auto config = out.defaultConfig(TX_MODE);
config.sample_rate = sample_rate;
config.channels = channels;
config.bits_per_sample = 16;
config.pin_bck = 12;
config.pin_data = 2;
config.pin_ws = 0;
out.begin(config);
// Microphone settings
I2SStream i2sStream; // Access I2S as stream
auto config = i2sStream.defaultConfig(RX_MODE);
config.signal_type = PDM;
config.i2s_format = I2S_STD_FORMAT;
config.channels = channels;
config.sample_rate = sample_rate;
config.bits_per_sample = 16;
config.pin_bck = 12;
config.pin_data = 34;
config.pin_ws = 0;
i2sStream.begin(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment