Rmp3 and arduino 1.0 ide

Has anyone gotten this to work? I seem to be at a wall and no where to go. rmp3 doesnt seem to be compatible with version 1.0 of the ide, and the arduino uno r3 doesnt seem to want to work with 0022 of the ide... please help :)

Wow ok. I tried some psychic techniques:

Hmmm. I’m picturing some C code. It uses the RougeMP3 library. Wait. It uses the RougeMP3 and RougeSD libraries. Its red. Not wait, Santa. Christmas time!

Is this your code?

    #include <RogueSD.h>
    #include <RogueMP3.h>
    #include <NewSoftSerial.h>
     
    NewSoftSerial rmp3_serial(6, 7);
     
    RogueMP3 rmp3(rmp3_serial);
    RogueSD filecommands(rmp3_serial);
     
    int numberOfSongs;
    int lastSong;
    char path[96];
     
    const char *directory = "/";
     
     
    void setup()
    {
      Serial.begin(9600);
     
      Serial.println("Merry Xmas!");
     
      rmp3_serial.begin(9600);
     
      rmp3.sync();
      rmp3.stop();
     
      filecommands.sync();
     
      // mix up our random number generator
      randomSeed(analogRead(0));
     
      // get the number of songs available
      strcpy(path, directory);
      
      strcat(path, "*.mp3");  // we have to do this because the IDE thinks that "/*" needs to be terminated everywhere
     
      numberOfSongs = filecommands.filecount(path);
     
      lastSong = -1;
    }
     
     
     
    void playNextSong()
    {
      uint8_t s, i;
      char filename[80];
      char path[96];
      int nextSong = 0;
     
      if (numberOfSongs > 0)
      {
        // Select our next song randomly
        if (numberOfSongs > 2)
        {
          do
            nextSong = random(numberOfSongs);
          while (nextSong == lastSong);
        }
        else if (numberOfSongs == 2)
        {
          // we only have two songs
          if (lastSong == 0)
            nextSong = 1;
          else
            nextSong = 0;
        }
     
        // now, get our file name from file list
     
        filecommands.opendir(directory);
     
        for (i = 0; i <= nextSong; i++)
        {
          filecommands.readdir(filename, "*.mp3");
        }
     
        strcpy(path, directory);
        
        strcat(path, filename);
     
        rmp3.playfile(path);
     
        Serial.print("Playing: ");
        Serial.println(path);
     
        lastSong = nextSong;
      }
      else
      {
        Serial.println("No files to play.");
      }
    }
     
     
    void loop()
    {
      char c;
      uint8_t i;
      uint8_t lastvolume = 20;
      int16_t newtime;
     
      playbackinfo playinfo;
     
      char status = 'S';
      uint8_t playing = 1;
      uint8_t volume = 20;
      uint8_t boostOn = false;
     
      volume = rmp3.getvolume();  // this only gets the left volume
     
      playNextSong();
     
      while(1)
      {
        while(!Serial.available())
        {
          // we should do fancy stuff like flash lights on our Xmas tree here!
          // got lots of time!
          delay(200);
     
          status = rmp3.getplaybackstatus();
          playinfo = rmp3.getplaybackinfo();
     
          if (status == 'S' && playing)
            playNextSong();
        }
     
        // OOH!! got a character!
        c = Serial.read();
     
        switch(c)
        {
          case 'p':
            // pause
            if(status == 'D')
            {
              // fade in
              rmp3.playpause();
              rmp3.fade(volume, 400);
            }
            else if(status == 'P')
            {
              // fade out
              rmp3.fade(100, 400);
              rmp3.playpause();
            }
            else
            {
              // start playing
              playNextSong();
              playing = 1;
            }
            break;
          case 's':
            rmp3.stop();
            playing = 0;
            break;
          case 'n':
            playNextSong();
            playing = 1;
            break;
     
          case 'e':
            if(boostOn)
            {
              rmp3.setboost(0);
              boostOn = false;
            }
            else
            {
              rmp3.setboost(8, 6, 7, 3);
              boostOn = true;
            }
            break;
     
          case 'a':
            // jump back 5 seconds
            newtime = playinfo.position - 5;
            if (newtime < 0) newtime = 0;
            rmp3.jump(newtime);
            break;
     
          case 'd':
            // jump forward 5 seconds
            rmp3.jump(playinfo.position + 5);
            break;
     
          case 'k':
            if(volume < 254) volume+=50;
            if(status != 'D') rmp3.setvolume(volume);
            break;
     
          case 'i':
            if(volume > 0) volume--;
            if(status != 'D') rmp3.setvolume(volume);
            break;
     
        }
      }
    }

You load it into the 1.0 IDE.

Are these the errors?

/home/wthierry/sketchbook/libraries/RogueSD/RogueSD.h:184:10: error: conflicting return type specified for 'virtual void RogueSD::write(uint8_t)'
/home/wthierry/Applications/arduino-1.0/hardware/arduino/cores/arduino/Print.h:48:20: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from rmp3.cpp:2:0:
/home/wthierry/sketchbook/libraries/RogueMP3/RogueMP3.h:155:10: error: conflicting return type specified for 'virtual void RogueMP3::write(uint8_t)'
/home/wthierry/Applications/arduino-1.0/hardware/arduino/cores/arduino/Print.h:48:20: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from rmp3.cpp:3:0:
/home/wthierry/sketchbook/libraries/NewSoftSerial/NewSoftSerial.h:86:16: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
/home/wthierry/Applications/arduino-1.0/hardware/arduino/cores/arduino/Print.h:48:20: error:   overriding 'virtual size_t Print::write(uint8_t)'
/home/wthierry/sketchbook/libraries/NewSoftSerial/NewSoftSerial.h:88:16: error: conflicting return type specified for 'virtual void NewSoftSerial::write(const uint8_t*, size_t)'
/home/wthierry/Applications/arduino-1.0/hardware/arduino/cores/arduino/Print.h:50:20: error:   overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
rmp3.cpp:11:30: error: no matching function for call to 'RogueMP3::RogueMP3(NewSoftSerial&)'
/home/wthierry/sketchbook/libraries/RogueMP3/RogueMP3.h:110:5: note: candidates are: RogueMP3::RogueMP3(Stream&)
/home/wthierry/sketchbook/libraries/RogueMP3/RogueMP3.h:103:1: note:                 RogueMP3::RogueMP3(const RogueMP3&)
rmp3.cpp:12:37: error: no matching function for call to 'RogueSD::RogueSD(NewSoftSerial&)'
/home/wthierry/sketchbook/libraries/RogueSD/RogueSD.h:110:5: note: candidates are: RogueSD::RogueSD(Stream&)
/home/wthierry/sketchbook/libraries/RogueSD/RogueSD.h:101:1: note:                 RogueSD::RogueSD(const RogueSD&)

Okay so if the answer is yes, then the problem is that the Rouge libraries have not been updated for 1.0. You might be able to make some simple changes to get them working. Check this thread: http://arduino.cc/forum/index.php?topic=82441.0

How did I do?

A) Crap - not a good psychic, keep your day job.
B) Shows promise.
C) Awesome! Give me a working library!

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC! thanks. Ill take a dive into C world.....

Lol ok.

I did some quick hacking at the RougeSD and RougeMP3 libraries to get you going. I looked at each error from the IDE and changed the code to fix the error. They compile with your sketch, but I don’t have an rmp3 so I can’t get them working for you. They’re probably close to working - the part of the code that may need work is the write() function in both libraries. With the 1.0 core those functions now have to return something so take a look at the print class in the core and see what the write() function returns and do the same thing in the Rouge libraries.

If you get it working you could send the updated code to Rouge guys to help them and everyone out. http://code.google.com/p/rogue-code/. Maybe post it back here too.

Rouge1.0.zip (28.5 KB)