DirectSound and mp3 . ! ?

Started by
2 comments, last by PumpkinPieman 18 years, 11 months ago
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
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.

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.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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. :)

This topic is closed to new replies.

Advertisement