Advertisement

MP3 and DirectSound

Started by January 31, 2000 01:28 PM
5 comments, last by Sphet 25 years, 1 month ago
Does anyone have any information on how I can implement the playback of MP3 files with directsound in my game?

I believe (check me) the mp3 format is copyrighted.
Advertisement
yea the mp3 format is copyrighted , but there are ways to play mp3s.

check out the direct x section of
http://cust.nol.at/ppee/mainframeeng.htm

the mp3 playing code on this site uses a dll with the decoding functions to play the mp3s. i''m not sure but i don''t think you have any restrictions using the dll so you could probably use it for non-commercial and commercial games.

also check out the golgotha source at
http://www.crack.com/

the source has actual code to decode an mp3, but you can only use it for non-profit use.
DirectSound requires that all sound data be in Pulse Code Modulation(PCM) format before being transferred to the seconary sound buffer. If you decode the MP3 to PCM and then stream to a DSound buffer, you can playback MP3''s using DirectSound. The Fraunhoffer CODEC is supplied with Windows 98 and Windows Media Player, and Im fairly sure you can use the MCI command strings to decompress the MP3 using it; however, I believe you can probably write a less CPU dependent version or use code from the Golgotha source(which is freely available on the net) as a starting point for writing an MP3 decoder.

--Until all sound cards have a built HW decoder,
Cauldron

There is a way to decode mp3 and play it in realtime becase Winamp does it. I forgot to point out that it plays in direct sound.

Edited by - nes8bit on 2/1/00 8:19:37 PM
U must use ''acm_'' (audio compression manager) functions and procs to decode Wav'' (from any format supported in current system) to PCM. It''s described in MSVC help files as ''Format converting'' under ACM subtopic. Check it.

Always happy to help.

[Cause nobody can do it like mixmaster can]-+-+-{BEaSTy BOYs}

Maluke [MLKent@mail.ru]
[Cause nobody can do it like mixmaster can]-+-+-{BEaSTy BOYs}Maluke [MLKent@mail.ru]
Advertisement
U must use ''acm_'' (audio compression manager) functions and procs to decode Wav'' (from any format supported in current system) to PCM. It''s described in MSVC help files as ''Format converting'' under ACM subtopic. Check it.

Note: you sounds should be in WAV files with internal MP3 compression.

Always happy to help.

[Cause nobody can do it like mixmaster can]-+-+-{BEaSTy BOYs}

Maluke [MLKent@mail.ru]
[Cause nobody can do it like mixmaster can]-+-+-{BEaSTy BOYs}Maluke [MLKent@mail.ru]

This topic is closed to new replies.

Advertisement