gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > the best type of sound

#6472 - ken - Mon May 26, 2003 9:20 pm

i want to aske what is the best format of sound to use , and if i can use MP3 format,in gba games...

#6474 - Maddox - Mon May 26, 2003 10:02 pm

Yes, you can use MP3s in your GBA game.
_________________
You probably suck. I hope you're is not a game programmer.

#6486 - Sweex - Tue May 27, 2003 11:58 am

I haven't seen or heard of a single GBA project that uses MP3 for playback up till now... (Maybe on a really low bitrate, but I'd still wonder why youwant that as it is surely going to eat up lots of cycles)

#6493 - Maddox - Tue May 27, 2003 8:50 pm

Dear Sweex,
Not everything has to be realtime, honey.

Love,
Maddox
_________________
You probably suck. I hope you're is not a game programmer.

#6494 - DekuTree64 - Tue May 27, 2003 9:13 pm

Most people use MODs for music, and unless you have a lot of unneeded EWRAM to decompress samples to, the samples are stored uncompressed in ROM.
Writing a good sound mixer in a whole art in itself, but there's plenty of info to get you started just on this board. Basically the idea of a mixer is to add samples together, so first start off by just doing a for loop every frame where you load in samples and add them into a buffer, which is played by the DMA.
Then either ask for help, or just go read the mixer-related posts on here.

#6503 - tepples - Tue May 27, 2003 10:30 pm

Yes, most games use a tracked format such as MOD, S3M, or XM, but I have developed a proof of concept demo that plays an 18 kHz 4-bit ADPCM compressed version of "Hot Limit" by John Desire using 15% of CPU time. (A 4-bit ADPCM waveform sounds about as good as an 8-bit raw waveform.) This can fit a half hour of audio into a 128 Mbit cartridge.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#6523 - Sweex - Wed May 28, 2003 9:40 am

Maddox, darling... Ken asked whether he could use (for instance) MP3 in a GBA game, so I'd say that pretty much means realtime! (Extracting to the limited amounts of RAM before playing doesn't sound like a good option to me, as that would not be realtime)

#6546 - Maddox - Wed May 28, 2003 6:51 pm

Sweex,
Way to think inside the box!
_________________
You probably suck. I hope you're is not a game programmer.

#6550 - tepples - Wed May 28, 2003 7:42 pm

Maddox wrote:
Way to think inside the box!

"Inside the box" is entirely appropriate at times. For software-only playback, all decoding must happen "inside the box". I'd imagine that an MP3 decoder on cartridge would be more expensive both for the Nintendo license fee and for actually manufacturing such a cartridge.

Even if you decompress MP3 entirely to mono 18kHz 8-bit PCM before playing it and fill the entirety of EWRAM with cached decompressed audio, you're only going to fit about 14.4 seconds of MP3 in RAM. And aren't "loading" delays the main reason to stick with carts instead of discs?

I'd say that if you want to use a recording of a live performance (as opposed to tracked music), you should try compressing it with ADPCM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.