Can anyone point me in the direction of Mp3 player code?

Started by
9 comments, last by Avengre 22 years, 3 months ago
I wanna add mp3 player into my code, to add background... I assume this is done often... I''ve been pointed to Fmod, but i found it really hard to incorporate it into the code (can anyone point out some tutorials other than those on fmods site?) And SDL... but i had similiar problems with that? Please help?
- Trust no one -
Advertisement
mp3 player code will likely be more difficult to implement than fmod or sdl but here''s a url to get you started

http://www.mp3-tech.org/

‘But truth's a menace, science a public danger.’ Brave New World, Aldous Huxley
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Im jus pretty much tryin to find a way to play mp3''s within my programs...music adds so much to a program
- Trust no one -
Rather than MP3, which is proprietary and stuff, you could try OGG. There''s a piece of code up on flipcode (www.flipcode.com, go to the code of the day gallery) that will play ogg files. They''re just like mp3, but it''s free! yay!
try microsoft''s directshow.
life is unfair, take advantage of it.UNMB2 - if the link doesn't work, try clicking it :)
tsuraan: they don''t necessarily have to be proprietary. it all depends on what they were created from. if you recorded the original file then its yours but still has no copyrights. The only problem is that nobody who is a game programmer is a band leader or the like.
HelplessFool: The mp3 file format is proprietary. In other words, if you plan to create software that uses this format, then you probably have to pay a licensing fee in order to use the format (the fee might only apply to commercial software though). The OGG file format is not proprietary, which means that you can use it without paying anything to anyone.

Who owns the copyright to the music, whatever the file format, has nothing to do with whether or not the format is proprietary. OGG files, altough free from proprietary restraints, are still subject to copyright law.

j.w.


Edited by - jwace81 on January 2, 2002 6:23:07 PM
is it just me or microsoft did license it for dshow?
and if you want to use the dshow way you can check my www page (warsztat.pac.pl/mirekcz - press the projekty link) and download my tiny mp3 player. It''s not well commented but it works and might be an additional help to dx8sdk explanation.

Hope it helps

With best regards,
Mirek Czerwiñski
http://kris.top.pl/~kherin/
With best regards, Mirek Czerwiñski

You can use the following code
Note that you have to rename the mp3 to mpa

mciSendString("open myfile.mpa alias music", NULL, 0, NULL);
mciSendString("play music", NULL, 0, NULL);

...

mciSendString("stop music", NULL, 0, NULL);
tsuran: pardon me, i misinterprited what you meant by proprietary reffering to ownership of the original file like the whole napster copyright deal rather than the file format and codecs being the proprietary stuff.

This topic is closed to new replies.

Advertisement