Hello!
The cause of the problem is probably that the I2S configuration in the "Audio.h" directory is overwritten.
When the object is created, the constructor function is executed, which sets up the I2S peripheral:
////////////////////////////// AUDIO ////////////// // // /////////////////////
Audio audio;
////////////////////////////////////////////////// ///////////////////////////////////
Then the "Setup" function of the Arduino environment is run, in which the following is called:
////////////////////////////////////////////////// /// //////////////////////////
void setup() {
M5.begin();
..............
////////////////////////////////////////////////// ///////////////////////////////////
Which again performs an I2S configuration that overwrites the previous settings.
The solution is to prevent this override by defining the function parameters and disabling the speaker:
////////////////////////////////////////////////// /// //////////////////////////
void setup() {
M5.begin(true, true, true, true, kMBusModeOutput, false);
..............
////////////////////////////////////////////////// ///////////////////////////////////
The last parameter is the speaker, which is thus disabled.