Play Music (MP3, WAV,...) for greeting card


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Play Music (MP3, WAV,...) for greeting card

    Hello,

    Is there any way to play music (MP3, WAV, ..) using a PIC as the "player's" controller?

    I have to make a greeting-card with text (LCD display) and sound (music). LCD is simple, music else than a buzzer....

    I found some special IC lioke the "STA013" from PJRC.COM and the "Melody MP3" from ANALOG.COM (can't find tech infos on this one) but they seem quite complicated... at lest to me.

    Any idea is welcome.
    Roger

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Hello,

    Is there any way to play music (MP3, WAV, ..) using a PIC as the "player's" controller?

    I have to make a greeting-card with text (LCD display) and sound (music). LCD is simple, music else than a buzzer....

    I found some special IC lioke the "STA013" from PJRC.COM and the "Melody MP3" from ANALOG.COM (can't find tech infos on this one) but they seem quite complicated... at lest to me.

    Any idea is welcome.
    Read all the info from PJRC and my site on the STA013. It's a bit of a pain to use. Might be better off going with a VS1001k, not sure haven't used it. Once I got the STA013 working, I stuck with it. I use it in my own mp3 player.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Code sample

    Hi Skimask,

    Thanks for your reply.

    Would you have a code sample for me?

    In your opinion, on a scale from 1 to 5 (1=lowest/5=highest), what would be the technical level needed to achieve this type of circuit (need a circuit playing 1 music file continously)?
    Roger

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Hi Skimask,

    Thanks for your reply.

    Would you have a code sample for me?

    In your opinion, on a scale from 1 to 5 (1=lowest/5=highest), what would be the technical level needed to achieve this type of circuit (need a circuit playing 1 music file continously)?
    STA013 - I2C controlled, you have to 'load' a 4K boot file to the STA013 thru I2C before it'll do anything (ST Micro claims it's a security mechanism, I think it's a patch file for the internal DSP). After that, it's a 'simple' matter of getting music file from eeprom (or wherever) and shifting it out the a couple of SPI pins to the STA013.

    My opinion? I don't know how good you are (i.e. what you've done already). It's a piece of cake for me now that I've done it a few times.

    Code - I've got a bunch of stuff, I don't know whether or not you'll be able to make use of it since I designed the code to fit around my hardware (keys, LCD, hard drive, STA013, eeprom, FTDI245AM USB chip, etc.etc.) and I don't have it here with me at the moment. Did you check PJRC and my site for hints? PJRC has a really good writeup on how to run the STA013, http://www.pjrc.com/tech/mp3/sta013.html .


    I just attached my personal mp3 player PBP code. This is first anybody else will have ever seen the complete code, not that it's secret or anything like that, but quite frankly, what is anybody else going to do with the code that doesn't have the hardware to go with it?

    It's got a lot of stuff in it, as mentioned above, IR receiver (w/ Sony IR code handling in it), some string handling/sorting routines, hard drive access/formatting/reading/writing/etc, eeprom, LCD, keypad handling, my own file system handling, STA013 control and use (the STA013 patch code mentioned above is actually located in an off chip eeprom at the top of the eeprom's memory space, if you really wanted to, I could read the eeprom back into a hex file and you could use that to do the patch code, basic read byte, write byte.), hard drive buffering (along with an optional compact flash card as a slave set up as a huge buffer to save battery power), scrolling filename display, analog battery voltage monitoring, keypad polling, IR led receiver polling, timed interrupts,

    I'm sure if some of the more experienced people read thru the code a bit (i.e. Melanie, Darrel, mister_e, etc), they'd probably get a bit of a kick out of it. Hey, I didn't know any better at the time but it worked for me! The only reason I put the player away permanently is because there was a bolt inside that came loose and that bolt and a washer ended up underneath the power supply. I let all the smoke out of the power supply and a few other parts....and we all know that these pieces/parts come pre-packaged from the factory with a certain amount of smoke placed in them. If you let the smoke out, they quit working!!!
    Last edited by skimask; - 10th January 2007 at 02:45. Reason: Added mp3 player code and some notes

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default MP3 player code

    Forgot to add the code
    Attached Files Attached Files

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    LMAO!.. really liked this one
    ...and we all know that these pieces/parts come pre-packaged from the factory with a certain amount of smoke placed in them.
    I thought it was normal at the firsts use as they are brand new
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default ...

    Well,

    After having a first look at your code, the isn't "a piece of cake" to me. It's more a piece of cheese filled with lots of holes...

    On the other hand, the hardware looks rather simple.

    If y can find one of these chips here, I'll go for a try.

    Thanks a lot.
    Roger

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Well,

    After having a first look at your code, the isn't "a piece of cake" to me. It's more a piece of cheese filled with lots of holes...

    On the other hand, the hardware looks rather simple.

    If y can find one of these chips here, I'll go for a try.

    Thanks a lot.
    Mouser sells the STA013 in a BGA49 package. I might have a couple extras laying around already on a SOIC-28->DIP28 converter package. I'll check if you really want to mess with this.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    LMAO!.. really liked this one


    I thought it was normal at the firsts use as they are brand new
    Well, ya know, cars engines are the same way. They burn off the smoke installed at the factory at a certain rate. We keep adding smoke to the back of them at the fuel station. Eventually, the car burns smoke at a faster rate than we can add it back in we have to rebuild the engine with new smoke.

  10. #10
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Cool!

    Okay.

    Let me know if you can put a hand on it!
    Roger

Similar Threads

  1. Embedded MP3 player from Sparkfun
    By ScaleRobotics in forum General
    Replies: 3
    Last Post: - 10th March 2010, 04:41
  2. Reading Magnetic Card on Pic16f876
    By Finn in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 4th February 2004, 23:36

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts