I have hooked up a micro sd card to the Arduino pro mini. I am using the TMRpcm library to play the wav files that I have converted to 8 bits 32khz and mono, as instructed. I can get the audio to play but the speech is slowed down by at least a factor of 2 or more. Any ideas on what I've done wrong?
Heres the code I am using:
#include <SD.h> // need to include the SD library
//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 10 //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm; // create an object for use in this sketch
void setup(){
tmrpcm.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
tmrpcm.quality(1);
tmrpcm.volume(2);
tmrpcm.play("1.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}
void loop(){
if(Serial.available()){
if(Serial.read() == 'p'){ //send the letter p over the serial monitor to start playback
tmrpcm.play("1.wav");
}
}
}