#11800 - Issac - Sun Oct 19, 2003 3:48 pm
It's possible to play MP3's on a gba, with the Music Player Advance... then It should be possible to play the songs in my own game too.. right?
well, I need to know how!
And I have no clue at all, so so much info as possible please!
thankyou!
_________________
yeah, well, maybe... or? anyways.... eh... what was i talking about??
#11801 - tepples - Sun Oct 19, 2003 4:18 pm
Some of the MP3 players have a decoder on the cart. The flash carts don't. You'll need to use a codec with a software decoder, and the GBA's processor is too slow to use MP3. I recommend my free 8ad codec.
But if you're making your own recording (as you must under copyright law) and possibly writing your own music (as you must under copyright law if you're not adapting a pre-1923 composition), can you write it in a tracker such as Modplug Tracker? In that case, you could use AAS or Krawall to play it back.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#11816 - Issac - Mon Oct 20, 2003 7:47 am
well, its not too slow! i can play mp3s on the EZflash, with a program that makes *.gba files out of *.cmp (dont remember the filetype exactly) that you make out of mp3s.... And it have to be (with the best quality) 16-bit, stereo, 16000...... (dont know what the last is.. think its Hz)
but with that quality, it fits 10minutes on 70Mbit.. :D
well...
It should be possible to make.. if you convert the mp3 to some other type, and reduce the quality....
Correct me if im wrong...
_________________
yeah, well, maybe... or? anyways.... eh... what was i talking about??
#11817 - DekuTree64 - Mon Oct 20, 2003 8:35 am
Issac wrote: |
16-bit, stereo, 16000...... (dont know what the last is.. think its Hz)
but with that quality, it fits 10minutes on 70Mbit |
16000*60*10 (seconds and minutes) = 9600000 = 9.15MB = 73.2MBit. Since GBA's sound hardware only does 8-bit output, that converter thing probably converts it to 8-bit, and then compresses it with something like Tepples' 8ad, so it's about half size and thusly can be stereo and still fit in that space. In other words, it's not MP3. I've seen battles on the GBADev Yahoo list over wether the GBA's processor is fast enough to do it, and I have yet to see a working example.
But seriously, tracked music is almost always good enough for games, as long as your songs don't have any singing in them, and even that can be overcome by playing the voice as a regular channel (best to compress it somehow though, but it's less noticable to have a quality drop in the voice when all the instruments are full quality). If you really want wave-type music for your game, I'd suggest 8ad (which can be found at http://www.pineight.com/gba/)
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#11818 - Issac - Mon Oct 20, 2003 9:28 am
Allright, ill try that... but then the thing is, how do I add the song to my game??!
and the song have vocals :D
_________________
yeah, well, maybe... or? anyways.... eh... what was i talking about??
#22682 - tepples - Sat Jun 26, 2004 8:24 pm
To start off, here's what you do: - Choose a codec based on a space/speed tradeoff. I maintain two audio codecs with GBA decoders. The 8ad codec is based on simple ADPCM with a few changes designed to extend slope headroom; at 18157 Hz, it runs at about 620 kBytes/min and uses 6% of CPU time. The GSM codec uses a more sophisticated linear-predictive model with pitch feedback; it runs at about 220 kBytes/min and uses a bit over 50% of CPU time.
- Prepare the audio: convert it to 16-bit 18157 Hz mono PCM wave file.
- Encode the audio with the tool included with the codec. You'll get a .8ad or .gsm file.
- Put the assets in your game using bin2s, GBFS, or the like.
- Put the decoder in your game (PM me if you want help with this integration step).
(Bumped because I felt like it and because I'm about to update the GSM player in a day or so.)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.