TMRpcm SdFat Problem

Hello everyone. I’m new to the forum. I am having a problem with the SDfat library in conjunction with the TMRPCM library.

The following error I encounter when I try to compile the code:

D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: In member function 'void TMRpcm :: createWavTemplate (char *, unsigned int ) ':
D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: 1609: 5: error: ‘SdVolume’ was not declared in this scope
SdVolume vol;
^
D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: 1609: 14: error: expected ‘;’ before ‘vol’
SdVolume vol;
^
D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: 1616: 13: error: ‘class Sd2Card’ has no member named ’ init
if (! card1.init (SPI_FULL_SPEED, CSPin)) {
^
D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: 1620: 6: error: ‘vol’ was not declared in this scope
if (! vol.init (& card1)) {} // Serial.println (“card failed”); }
^
D: \ Users \ guilherme.defalque \ Desktop \ arduino-1.6.3-windows \ arduino-1.6.3 \ libraries \ TMRpcm-master \ TMRpcm.cpp: 1621: 21: error: ‘vol’ was not declared in this scope
if (! rut.openRoot (& vol)) {} // Serial.println (“openRoot failed”); }
^
Compiling error.

Remembering that I did the requested procedure for the use of the library:

The line #define SDFAT MUST be uncommented in pcmConfig.h.

I’m using IDE 1.6.3 and the SdFat library from this location: GitHub - greiman/SdFat: Arduino FAT16/FAT32 exFAT Library.

Could someone please help me? Thank you.

Without seeing the code that produces these errors? Probably not.

Steve

Sorry for not having provided the Code. I did not mind that. O código é o exemplo SdFat existente na biblioteca TMRpcm.

Code:

/*
This example demonstrates how to use the SDFAT library for audio playback.
Read time and program space are reduced by using SDFAT directly

Requirements:
The SDFAT library must be installed. See http://code.google.com/p/sdfatlib/
The line #define SDFAT MUST be uncommented in pcmConfig.h

“error: ‘File’ has not been declared” means you need to read the above text
*/

#include <SdFat.h>
SdFat sd;

#define SD_ChipSelectPin 53 //use digital pin 4 on arduino Uno, nano etc, or can use other pins
#include <TMRpcm.h> // also need to include this library…
#include <SPI.h>

TMRpcm audio; // create an object for use in this sketch

void setup(){

audio.speakerPin = 11; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
pinMode(12,OUTPUT); //Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45

Serial.begin(115200);

if (!sd.begin(53, SPI_FULL_SPEED)) { return;
}else{ Serial.println(“SD OK”); }

audio.play(“song.wav”);
}

void loop(){

if(Serial.available()){
switch(Serial.read()){
case ‘p’: audio.play(“song.wav”); break;
default: break;
}
}

}

Thank you.

Someone?

Hi,

Did you ever resolve this issue? I'm having the same problem...

Hi,
right now I am asking myself why you would choose to use the SDFat library. You can just format your sd card with windows with the tutorial from the TMRpcm library.
I can provide some information I used when working with the TMRpcm library:

SD-Card Format: Fat32
Samplerate: 8-32 khz
Musicformat: wav
PCM-Format: unsigned 8-bit
Audio-Channel: Mono
Music-Rate: 8 bit

if you like to convert your songs you can take this link: Convert audio to WAV

Notice: Don't use a 8 ohm Speaker for your arduino. It won't be any good.
PS: For posting your Code please use the code tags. Thank you!