Arduino Uno Playing Slow Motion Sound from SD Card - Need Help!

Morning guys, I have connected an Arduino Uno with two speakers and a DFR0071 SD card module. The problem is when I play the recorded sound in .wav format, it plays in slow motion. Do you have any ideas? Because I'm completely stuck, thanks. Here is the code I am using:
#include <SD.h>
#include <TMRpcm.h>
#include <SPI.h>

#define SD_ChipSelectPin 10 // CS pin for the SD card
#define SpeakerPin 9 // Pin for the speaker (use pin 9 on the Arduino Uno)

TMRpcm audioPlayer; // Create an object for the speaker control library

void setup() {
// Start the serial communication for debugging purposes
Serial.begin(9600);

// Check if the SD card is present and initialized
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD card initialization failed!");
return; // Stop if it's not initialized
}

audioPlayer.speakerPin = SpeakerPin; // Define the speaker pin
audioPlayer.setVolume(7); // Set the volume (0 to 7)
audioPlayer.quality(1); // Set audio quality (0 for low, 1 for high)

Serial.println("SD card initialized.");
}

void loop() {
Serial.println("Playing audio...");
audioPlayer.play("1.wav"); // Play the audio file named "1.wav" from the SD card
delay(3000); // Delay to allow the audio to play
audioPlayer.disable(); // Disable the audio player
delay(2000); // Delay before the next loop iteration
}
#include <SD.h>
#include <TMRpcm.h>
#include <SPI.h>

#define SD_ChipSelectPin 10 // CS pin for the SD card
#define SpeakerPin 9 // Pin for the speaker (use pin 9 on the Arduino Uno)

TMRpcm audioPlayer; // Create an object for the speaker control library

void setup() {
// Start the serial communication for debugging purposes
Serial.begin(9600);

// Check if the SD card is present and initialized
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD card initialization failed!");
return; // Stop if it's not initialized
}

audioPlayer.speakerPin = SpeakerPin; // Define the speaker pin
audioPlayer.setVolume(7); // Set the volume (0 to 7)
audioPlayer.quality(1); // Set audio quality (0 for low, 1 for high)

Serial.println("SD card initialized.");
}

void loop() {
Serial.println("Playing audio...");
audioPlayer.play("1.wav"); // Play the audio file named "1.wav" from the SD card
delay(3000); // Delay to allow the audio to play
audioPlayer.disable(); // Disable the audio player
delay(2000); // Delay before the next loop iteration
}
3 Replies
Camila_99$$
Camila_99$$ā€¢4mo ago
Troubleshooting Steps I Have Tried:āœ… 1/Checked that the SD card is properly initialized and the file "1.wav" is present. 2/Converted the .wav file to 8-bit, mono, and a sampling rate of 16 kHz using Audacity. 3/Tried different .wav files with the same results. 4/ Verified that the TMRpcm library supports the .wav file format used. Despite these steps, the sound still plays in slow motion. Any suggestions on what might be going wrong or other troubleshooting steps I can try? Thanks in advance!šŸ™šŸ»
Joseph Ogbonna
Joseph Ogbonnaā€¢4mo ago
i can share some guide and example code you can try out, if it still persist, i will say you check out another module. it might be their might be fault somewhere. https://wiki.dfrobot.com/SD_Module__SKU__DFR0071_
SDModuleSKUDFR0071-DFRobot
wiki:This DFRobot SD card shield is a Break out board for standard SD card. It allows you to add mass storage and data logging to your project.
Joseph Ogbonna
Joseph Ogbonnaā€¢4mo ago
Instructables
SD Card Module With Arduino: How to Read/Write Data
SD Card Module With Arduino: How to Read/Write Data: Overview Storing data is one of the most important parts of every project. There are several ways to store data according to the data type and size. SD and micro SD cards are one of the most practical ones among the storage devices, which are used iā€¦
Want results from more Discord servers?
Add your server