#include #include TMRpcm tmrpcm; void setup() { // Initialize Serial Monitor Serial.begin(9600); // Initialize microSD card if (!SD.begin(10)) { Serial.println("SD card initialization failed!"); return; } // Initialize audio player tmrpcm.speakerPin = 9; // Set the speaker pin } void loop() { // Check if the file exists if (SD.exists("sound.wav")) { // Play the audio file tmrpcm.play("sound.wav"); // Wait for the playback to finish while (tmrpcm.isPlaying()) { delay(100); } } else { Serial.println("File not found!"); } // You can add more logic or loops for continuous playback as needed }