Jump to content
  • Advertisement

Archived

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

Loginius

DirectSound and MP3

This topic is 6412 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

Advertisement
As far as I know there are no tutorials which show how to play mp3 with directsound, since directsound only supports wave and midi. An option would be to use directshow

Share this post


Link to post
Share on other sites
Thanks!

I will look into directshow. Thanks!

I used to programm a lot under DOS, using standard C. I did not program anything since almost 10 years. I am currently learning, c++ and directx. Lucky for me I learn fast, after only a week, I am now into adding sound to my program, and I thought that since MP3 are smaller than wave I could use that for background music.

Does this make sense?

Share this post


Link to post
Share on other sites
Bonjour,

You have an alternative solution:

You have the ACM ( audio compression manager ) from Microsoft, which show you how to use codecs: it is provided in the Multimedia help file of VC6++, or on their site: there are some acm functions which let you deal with codecs. In Win2K, Me and may be 98, the MP3 codec is provided.

You have another solution, so as to say: TO CODE YOUR OWN DECODER: sources are provided at www.mp123.org.

Now what you need is a real-time decompression : If you look at the DSound doc, there are few lines about Compressed sound: you have just to lock a DSound buffer on the buffer that will output your decompression.

I have never experienced it, because acm manipulation is too complex, but Since We have been making a game , before June, we will have to deal with that. So if you manage to make it works before, let us know.

Share this post


Link to post
Share on other sites
I have found that writing your own decoder is a bit more time consuming when some one has already done it for you. Check out FMOD. It is a free api and dll, as long as you don''t charge for your product, that can load and/or stream wav, mod, midi, and mp3 using either DirectSound or other API''s. I have had very good success with it, and it is a sinch to program with. Take a look.

http://www.fmod.org

Kevin =)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!