Go Down

Topic: audio record and playback - conflicts when combining TMRpcm.h and SdFat.h (Read 549 times) previous topic - next topic

mummie

I'm working on a project which basically is a .wav audio playback and recorder on a Arduino UNO rev3.

I now have two sets of code:
1. A recorder sketch, manipulated to fit my buttons and such. Based on this project:
http://www.apcmag.com/arduino-projects-digital-voice-recorder-part-2.htm/
working perfect.

2. a playback sketch that reads .wav files from SD card and output to pin9, using TMRpcm.h.
working perfect.

When I try to combine both, I get error message as soon as I use both TMRpcm.h and SdFat.h in one sketch. Any solutions, tips are very much appriciated!

Code: [Select]
Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Uno"

/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp: In member function 'byte TMRpcm::metaInfo(boolean, char*, char*, byte)':
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1381:18: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   char* datStr = "LIST";
                  ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1382:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   if(infoType == 1){datStr = "ID3 "; datStr[3] = 3;}
                            ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
  char* tagNames[] = {"INAM","IART","IPRD"};
                                          ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1430:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
                ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1430:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
                                      ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1430:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
                                                           ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp: In member function 'void TMRpcm::finalizeWavTemplate(char*)':
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1568:65: warning: narrowing conversion of '(fSize >> 16)' from 'long unsigned int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
  seek(4); byte data[4] = {lowByte(fSize),highByte(fSize), fSize >> 16,fSize >> 24};
                                                                 ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1568:77: warning: narrowing conversion of '(fSize >> 24)' from 'long unsigned int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
  seek(4); byte data[4] = {lowByte(fSize),highByte(fSize), fSize >> 16,fSize >> 24};
                                                                             ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp: In member function 'void TMRpcm::createWavTemplate(char*, unsigned int)':
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1608:5: error: 'SdVolume' was not declared in this scope
     SdVolume vol;
     ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1615:13: error: 'class Sd2Card' has no member named 'init'
  if (!card1.init(SPI_FULL_SPEED,CSPin)) {
             ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1619:6: error: 'vol' was not declared in this scope
  if(!vol.init(&card1)){}//Serial.println("card failed"); }
      ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1620:21: error: 'vol' was not declared in this scope
  if (!rut.openRoot(&vol)) {}//Serial.println("openRoot failed"); }
                     ^
/.../Arduino/libraries/TMRpcm-master/TMRpcm.cpp:1623:46: error: 'BLOCK_COUNT' was not declared in this scope
  if (!fil.createContiguous(&rut, fNam, 512UL*BLOCK_COUNT)) {
                                              ^
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Azeez_Jimoh

Go back to the original code version and Uncomment #define buffSize 128 AND #define ENABLE_RECORDING in pcmConfig.h and also #define BLOCK COUNT.

Go Up