Archived

This topic is now archived and is closed to further replies.

Is it possible to load an mp3 into directsound

This topic is 5772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to load an mp3 into directsound? I am useing trent polac''s directsound class and am trying to import an mp3? wavs and mids work but not MP3 Y? Thanx, ShCiPwA ----- ShCiPwA -----

Share this post


Link to post
Share on other sites
Ummm - check out DirectMedia... (I''ve seen a few game engine''s which use that to decode MP3''s)



-------- E y e .Scream Software --------
----------------------------------------
                                  /-\
    http://www.eyescream.cjb.net | * |
                                  \-/
----------------------------------------

Share this post


Link to post
Share on other sites
Maybe you should consider using FMOD. - it plays every conceivable sound format (including MP3 and ogg vorbis), it's got loads of cool features and it's amazingly easy. I'm a total C++ newbie yet I managed to get a basic MP3 player working in about ten minutes. If anyone here is planning on doing sound stuff, you've got to look into this.

[edit]Damn thing posted twice.[/edit]
_________
"Maybe this world is another planet''s hell." -- Aldous Huxley

Edited by - Lord FlatHead on February 21, 2002 12:56:49 PM

Share this post


Link to post
Share on other sites
Well, I have mailed you guys my basic MP3 class. It is by no means finished but it should give you a start.
If anyone else wants it:
mp3.zip

Edited by - shabaz on February 21, 2002 4:09:35 PM

Share this post


Link to post
Share on other sites
An easy way to play MP3s un Windows (Using the Windows Media Player engine) :

Link your application with winmm.lib.

Then just call :

LPSTR LpReturnString;

mciSendString("open music.mp3 alias myfile",
lpszReturnString, lstrlen(lpszReturnString), NULL);

mciSendString("play myfile", lpszReturnString,
lstrlen(lpszReturnString), NULL);

And before you exit your app, you have to unload the sound :

mciSendString("close myfile", lpszReturnString,
lstrlen(lpszReturnString), NULL);


I'm currently using a similar technique with NeHe's AVI tutorial to decode the sound from AVIs, it works great.

Edited by - Terran Marine on February 22, 2002 3:01:00 AM

Share this post


Link to post
Share on other sites