Jump to content
  • Advertisement
Sign in to follow this  
CastorX

DirectSound and mp3 . ! ?

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

Hy anybody! I have a problem (again). There are may DSound tutorials on the net. That's OK. But all (i hope, not all, but i can't find other) of these tutors are designed to play *.wav files. But how can i play mp3 (or mp2, or aac) files with DirectSound, with a wery simple procedure??? The question is simple, but i feel, the final answer will be difficult. Please send links, source codes, or anything for me! THX! Castor

Share this post


Link to post
Share on other sites
Advertisement
You generally use some external library to decode the MP3 format into a raw audio format (i.e. WAV) and use DirectSound only to output the result.
Try checking out tutorials on using libogg as a decoder and on using streaming in DirectSound.

Share this post


Link to post
Share on other sites

The easiest method for playing MP3 files using DirectX is to use DirectShow (an MP3 is effectively just like an MP2 movie with just a soundtrack and nothing else). The DirectShow examples have all the code you require.

The Windows Audio Compression manager (ACM) might be an alternative if you need to decode the MP3 into a raw waveform for playback through DirectSound.

Share this post


Link to post
Share on other sites
I've already looked in to this, your best bet is to just use vorbis ogg because you're not going to find much on MP3 streaming other then what is offered by DirectMusic.

Besides Ogg is smaller, better quality, and free. There for OGG > MP3. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!