ZFGC

Projects => Other Projects => Topic started by: Atrius on September 02, 2008, 04:52:25 pm

Title: [Demo] GBA Audio Player
Post by: Atrius on September 02, 2008, 04:52:25 pm
Perhaps, you remember I've been hecking data formats in Golden Sun (http://www.zfgc.com/forum/index.php?topic=24476.0).

When I moved on to the music, I worked on a couple classes in Action Script that would play the music back from the original binary data in real time.  I didn't realize it was a common format among GBA games until someone mentioned a lot of GBA games music was composed from the default sound library, and I decided to check it out.  So I took my Golden Sun audio playing engine slapped on some code to automatically detect where the audio data starts in a ROM, and viola, instant GBA audio player.  I say 'audio' instead of 'music' because most sound effects are stored in the same format as the music.

GBAjukebox.air (http://atrius.kousougames.co.uk/RandomStuff/GBAjukebox.air) (10 KB, small huh?)  READ NEXT PARAGRAPH ABOUT INSTALLING

A .air file is an installer for an Adobe Air (http://get.adobe.com/air/) application. Basically an Adobe Air Application is a Flash file that runs like a program instead of web applet, I needed to make the audio player that way so it could actually have access to the roms on your computer.  Of course you will need a GBA rom to use it, not all games will work with it, but I found a lot of popular ones do.  Don't ask where to get roms, we can't tell you anyway.

(http://img.photobucket.com/albums/v698/AtriusV/Games/GBAjukebox.png)
(hope I can get past the 4 screen shot rule since it's hard to take screen shots of audio)

Yes, the interface is really simple right now, and lacking in functionality.  You may also notice that some instruments in songs/sound-effects are replaced by computer generated tones, and that they may be very quiet.  There are still some features I haven't programmed into the audio playing system yet.  I forget if I left the red/green circle button in, if I did it toggles between generating the music at 22050 Hz (Red), and 44100 Hz (Green)  (I believe the GBA generates the music at 16384 Hz)

EDIT:

As a bonus here's a GBA audio ripping tool (http://atrius.kousougames.co.uk/RandomStuff/GBA_AudioRipper.zip) I put together (.zip 33.2KB).  If you drag & drop a ROM file on it, it'll dump the audio data from the ROM to "output.gbas" which can be played by GBAjukebox.  Unfortunately for you Mac/Linux users though it's a Win32 executable.
Title: Re: [Demo] GBA Audio Player
Post by: Infinitus on September 02, 2008, 04:57:44 pm
Nice. I'll check it out in a bit, goter install adobe air first u_u.

MOAR NATIVE CODE PLZ.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 02, 2008, 05:04:51 pm
Sorry, Action Script is the only language I know well enough that's also capable of producing audio from binary data (Even though I had to use a trick to do it)
Title: Re: [Demo] GBA Audio Player
Post by: Infinitus on September 02, 2008, 05:06:53 pm
Its not bad. I might suggest you create a list box with columns showing the length/frequency/size/etc of the tracks. At the moment its a pain in the arse trying to trawl through all the small useless sounds to find any of the music tracks or other usefull sound effects.

Quote
Sorry, Action Script is the only language I know well enough that's also capable of producing audio from binary data (Even though I had to use a trick to do it)
Open source? Somebody else may convert it when they have the time.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 02, 2008, 05:26:04 pm
I'll probably add a list box with some info on the songs when I get around to upgrading the interface, I probably should have mentioned you can type values into the song number box too though.

Another thing about it being an Adobe Air application is that it's cross-platform compatible.  It should work on Windows, and Mac.  Adobe is still working on a version of Air for Linux.
Title: Re: [Demo] GBA Audio Player
Post by: Moon_child on September 03, 2008, 11:02:19 pm
This program could be used to rip sound effects! :o
Title: Re: [Demo] GBA Audio Player
Post by: NickAVV on September 03, 2008, 11:05:39 pm
It works pretty well, aside from the fact that the tempo on some songs seems to be off. Also, Megaman Battle Network 3 seems to store certain songs as two separate files that would play concurrently, so it's impossible to hear those songs as they would sound in game.

EDIT: Oh, and this is on Mac
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 06, 2008, 05:06:09 am
Hyrule_boy, actually I think I'll write something to rip the instrument samples/sound effects as .wav files without going through all the processing in the audio playback system.

Moldorma, I might have the default tempo wrong, or maybe one of the commands I haven't programmed in yet affects tempo somehow.  It might help if you could give me the game name, and song number of some of the songs.  Thanks for testing it on a Mac though, glad to hear it works alright.

Title: Re: [Demo] GBA Audio Player
Post by: DJvenom on September 06, 2008, 05:57:05 am
This is actually VERY helpful o.o and Written in actionscript no less. I hope future versions will fix the tempo issues, but this is sweet :D
Title: Re: [Demo] GBA Audio Player
Post by: NickAVV on September 06, 2008, 02:32:48 pm
Erm, I deleted the game a while back (only downloaded it to test the app, since I own the real game). The game's name is "Mega Man Battle Network 3 - Blue". I was using the American version. The songs were pretty early in the list, but clearly recognizable as the harmony tracks for places like Yoka and ACDC town.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 06, 2008, 03:32:00 pm
Wow... That game uses a lot of the odder instrument types that I haven't programmed into the audio engine yet.  It's not that the game stores a single song as separate tracks played back at the same time, it's just my engine can't play back some of the instrument channels properly right now.

The tempo seems fine to me, it could sound off because of the missing instruments, or performance issues.  I'm making a few tweaks that should help performance a bit in the next version.
Title: Re: [Demo] GBA Audio Player
Post by: NickAVV on September 06, 2008, 04:17:09 pm
Okay, cool. I just said it was playing part of a song because that's what it sounded most like.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 09, 2008, 03:42:06 am
Here we go, Mega Man Battle Network 2 - Blue's title screen music, before adding decent support for instruments played on any of the GBA's 4 PSG sound channels, and after.

Before (http://atrius.kousougames.co.uk/RandomStuff/Before.mp3)

After (http://atrius.kousougames.co.uk/RandomStuff/After.mp3)

Still more work to be done to get volumes, and some other stuff right but it's a pretty big improvement.  After I get the audio engine working satisfactorily I'll start thinking about interface improvements, any specific requests though?
Title: Re: [Demo] GBA Audio Player
Post by: NickAVV on September 09, 2008, 11:36:44 pm
Nice, nice! :D That's an improvement alright. Might I suggest an interface more like so:

(http://i120.photobucket.com/albums/o180/MoldormaToo/gbajuke.png)

Or is that too cluttered? You decide. :P

Edit: and it finally comes out that I'm a sucker for some of Vista's interface elements. >.>
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 10, 2008, 11:06:46 pm
Well... Names aren't stored with the audio tracks, and there's no definite way to tell sound effects apart from songs.  Could probably check the lengths, or if they're supposed to loop continuously or not, but some sound effects do that too.

I also wanted to add a song list that showed some of the information available on the audio tracks so you could select them based on more than just a number.
Title: Re: [Demo] GBA Audio Player
Post by: Porkchop on September 10, 2008, 11:13:03 pm
You think it'd be possible to make it work with GBC and get GBC sounds?
Title: Re: [Demo] GBA Audio Player
Post by: Mirby on September 10, 2008, 11:15:54 pm
Umm... you need the sound effects for LA COOP, I might be able to get those for ya, Zidane. You need only ask.
Title: Re: [Demo] GBA Audio Player
Post by: Porkchop on September 10, 2008, 11:29:04 pm
Umm... you need the sound effects for LA COOP, I might be able to get those for ya, Zidane. You need only ask.

Ugh NO. Stop asking and stop bugging. I don't need any of them.

I asked for GBC sounds because I'm interested in other sounds from other games. Don't go off-topic again.
Title: Re: [Demo] GBA Audio Player
Post by: Mirby on September 10, 2008, 11:30:24 pm
Ok, sorry about that. I assumed. On-topic, I may have to check this out.
Title: Re: [Demo] GBA Audio Player
Post by: NickAVV on September 10, 2008, 11:31:28 pm
Well... Names aren't stored with the audio tracks, and there's no definite way to tell sound effects apart from songs.  Could probably check the lengths, or if they're supposed to loop continuously or not, but some sound effects do that too.

I also wanted to add a song list that showed some of the information available on the audio tracks so you could select them based on more than just a number.
Okay, wasn't sure what kind of data you were able to get from the tracks. :P A song list like that is a cool idea. Perhaps being able to sort by track number or length as well.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on September 11, 2008, 12:35:23 am
You think it'd be possible to make it work with GBC and get GBC sounds?

Maybe, I hadn't planned on it though.  GBC games definitely use a much different format for their music, although I believe the GBC's 4 PSG audio channels are essentially the same as the GBA's.  Unfortunately I haven't fully programmed those into my audio engine yet so far.
Title: Re: [Demo] GBA Audio Player
Post by: Atrius on October 02, 2008, 06:10:24 pm
I went ahead and uploaded the new version with some limited support for the instrument types the last one was missing.  It's at the same link.

As a bonus here's a GBA audio ripping tool (http://atrius.kousougames.co.uk/RandomStuff/GBA_AudioRipper.zip) I put together (.zip 33.2KB).  If you drag & drop a ROM file on it, it'll dump the audio data from the ROM to "output.gbas" which can be played by GBAjukebox.  Unfortunately for you Mac/Linux users though it's a Win32 executable.

EDIT:
Link for audio ripper fixed >_<

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved