Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

mp3 player in C

Options
  • 02-10-2012 4:21pm
    #1
    Registered Users Posts: 3


    Ima n00b in C but i want to program a chip to read mp3 and then play it but.... i need to make the program in C so does any1 know how to make it (tutorial,source code or documentation please)

    and i REALLY has to be in C not c++ or c# or any other language (so i can make a static library)

    thx :D


Comments

  • Registered Users Posts: 7,157 ✭✭✭srsly78


    http://stackoverflow.com/questions/428884/how-to-play-mp3-files-in-c

    Easy way: Use a library (fmod is used in link above)
    Hard way: Write your own decoder (here be dragons etc)

    Most modern devices like smartphones etc have special hardware onboard to perform the decoding, so there would be a system call to make use of this. Doing it via CPU would use a lot more power on a phone. PC is so powerful that decoding is no big deal tho.

    Oh, you can write static libraries in C++ btw (and mix it with C). So that isn't a valid reason for choosing only C. If you are limited to C because it's an embedded platform with limited toolchain then that would be a more valid reason.


  • Registered Users Posts: 3 yugic


    Thx alot :D

    but how do i compile static librarys in C++ O.o


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    With some kind of compiler option.... It depends what compiler you use. Here is how to do it for gcc: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html


  • Registered Users Posts: 3 yugic


    Thx a lot :D


Advertisement