For pins 12-15... PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[xx], PIN_FUNC_GPIO); SD card: https://github.com/espressif/arduino-esp32/tree/master/libraries/SD Sound: https://www.esp32.com/viewtopic.php?t=3693 for (z=0 ; z