Created
June 25, 2022 14:51
-
-
Save masuidrive/408e1991912f5166bbecef0860b68a9c to your computer and use it in GitHub Desktop.
Arduino audio-tools settings for M5Stack Core2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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