The only way to record four (4) channels is using the two (2) peripherals and left and right of both peripherals.
This involves hardware that is able to drive only the left or right channel like a digital microphone.
Otherwise you have to build some additional hardware.
To capture four microphones, make one peripheral master, the other slave.
The slave can use the same clock (CLK) and fsk (LRCLK) pins of the master due to the io-matrix of the esp32.
Code: Select all
// SPI SOUND
#define I2SDI_1_PIN (21) // DIN --> From external device(s)
#define I2SDI_2_PIN (22) // DIN --> From external device(s)
#define I2SDO_PIN (-1) // NA
#define I2SCLK_PIN (26) // BCLK
#define LRCLK_PIN (25) // LRCLK
master.begin( HSPI, I2SCLK_PIN, I2SDO_PIN, I2SDI_1_PIN, LRCLK_PIN ); // default SPI is HSPI
slave.begin( VSPI, I2SCLK_PIN, I2SDO_PIN, I2SDI_2_PIN, LRCLK_PIN ); // default SPI is VSPI