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 > Trouble using sounds in Apex

#24988 - dagamer34 - Sat Aug 14, 2004 5:11 pm

I am having trouble converting a .wav file to be used with Apex. Here's what it errors it spits out:

Code:

C:/Consoles/Development/GBA/DevKits/HAM/tools/win32/Conv2AAS.exe sfx

/---------------------------------------------\
| Conv2AAS v1.07        WAV, RAW & MOD -> AAS |
| Copyright (c) 2003, Apex Designs            |
\---------------------------------------------/

Adding WAV Ambulance.wav...
WAV_LoadSound( sfx/Ambulance.wav ): Failed: Zero length data subchunk...
Writing AAS_SampleData (Unique:0 Actual:0 Length:0)...Done!
Writing AAS_PatternData (Unique:0 Actual:0 Length:0)...Done!


I can't get it to work! If anybody wants to see if they can make the .wav file work, here's a *pitiful* link to the file, zipped(450KB).
www.geocities.com/dagamer34/mario.zip

Yes, the webhosting is crappy. I realize that. :)
_________________
Little kids and Playstation 2's don't mix. :(

#25010 - tepples - Sun Aug 15, 2004 1:11 am

dagamer34 wrote:
I can't get it to work! If anybody wants to see if they can make the .wav file work, here's a *pitiful* link to the file, zipped(450KB).
www.geocities.com/dagamer34/mario.zip

Yes, the webhosting is crappy.

I opened it in Cool Edit, and the sound quality is even crappier. Which emulator did you use to capture this?

I hex edited the file, and it seems to have extra chunks other than just fmt and data. Does Conv2AAS have trouble with extra chunks?

Have you tried making sure that the wav is a multiple of four samples in length?

Using AAS? You might have a better time with a MOD format conversion of the song rather than trying to load a 2 MByte wav file. Perhaps AAS has a limit on how big a wav file can be.

EDIT: Here ya go: http://pinocchio.jk0.org/gbaforum/mariobgm1.zip

See if any of these sound better.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25013 - jd - Sun Aug 15, 2004 2:07 am

dagamer34 wrote:

Code:

WAV_LoadSound( sfx/Ambulance.wav ): Failed: Zero length data subchunk...



AAS's WAV importer is very simplistic so the files have to be very specifically formatted for it to be able to process them. If you run the file through SoX with the following options then the file should work correctly (other programs should work as well, but SoX is what I've used in the past to do the job and it's free):

sox [source_filename] -s -b -c 1 [destination_filename]

You'll get a warning about .wav files not supporting 8-bit signed format - don't worry about that. (The command above also works if you want to convert to .raw format.)

You can get SoX here:

http://sox.sourceforge.net/

#25015 - tepples - Sun Aug 15, 2004 6:21 am

jd wrote:
AAS's WAV importer is very simplistic so the files have to be very specifically formatted for it to be able to process them.

Do you want help with improving its wav reader?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25023 - jd - Sun Aug 15, 2004 5:14 pm

tepples wrote:
jd wrote:
AAS's WAV importer is very simplistic so the files have to be very specifically formatted for it to be able to process them.

Do you want help with improving its wav reader?


Sure, if you're offering - although, as far as I can tell, adding support for all types of WAV is a pretty major job.

#25027 - tepples - Sun Aug 15, 2004 7:15 pm

The RIFF WAVE parser in the encoder from 8ad has properly read all mono and stereo linear-PCM .wav files that Cool Edit has thrown at it. It parses the RIFF chunk structure rather than just assuming a 44-byte "canonical" header. The WAVE code (readwav.c and readwav.h) is under a permissive license; it comes with a GPL'd demo (myima.c) showing how to open a wave file for reading samples.

If you need more help getting the library to work, just ask me.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25033 - dagamer34 - Sun Aug 15, 2004 8:59 pm

tepples wrote:
dagamer34 wrote:
I can't get it to work! If anybody wants to see if they can make the .wav file work, here's a *pitiful* link to the file, zipped(450KB).
www.geocities.com/dagamer34/mario.zip

Yes, the webhosting is crappy.

I opened it in Cool Edit, and the sound quality is even crappier. Which emulator did you use to capture this?

I hex edited the file, and it seems to have extra chunks other than just fmt and data. Does Conv2AAS have trouble with extra chunks?

Have you tried making sure that the wav is a multiple of four samples in length?

Using AAS? You might have a better time with a MOD format conversion of the song rather than trying to load a 2 MByte wav file. Perhaps AAS has a limit on how big a wav file can be.

EDIT: Here ya go: http://pinocchio.jk0.org/gbaforum/mariobgm1.zip

See if any of these sound better.


I used 2 emulators actually. I used VisualBoy Advance and PocketNES to get the music. I have a midi of the music but don't know how to write a midi player on the GBA.
_________________
Little kids and Playstation 2's don't mix. :(

#25034 - dagamer34 - Sun Aug 15, 2004 9:03 pm

jd wrote:
dagamer34 wrote:

Code:

WAV_LoadSound( sfx/Ambulance.wav ): Failed: Zero length data subchunk...



AAS's WAV importer is very simplistic so the files have to be very specifically formatted for it to be able to process them. If you run the file through SoX with the following options then the file should work correctly (other programs should work as well, but SoX is what I've used in the past to do the job and it's free):

sox [source_filename] -s -b -c 1 [destination_filename]

You'll get a warning about .wav files not supporting 8-bit signed format - don't worry about that. (The command above also works if you want to convert to .raw format.)

You can get SoX here:

http://sox.sourceforge.net/


I already tried running it through SOX and that's the error message that occured.
_________________
Little kids and Playstation 2's don't mix. :(

#25040 - jd - Sun Aug 15, 2004 9:58 pm

dagamer34 wrote:

I already tried running it through SOX and that's the error message that occured.


I just tried it and it works fine once it's been processed by SoX. Are you sure you weren't accidentally using the old file or something like that?

#25044 - tepples - Sun Aug 15, 2004 10:34 pm

dagamer34 wrote:
tepples wrote:
I opened it in Cool Edit, and the sound quality is even crappier. Which emulator did you use to capture this?


I used 2 emulators actually. I used VisualBoy Advance and PocketNES to get the music.

PocketNES's sound sucks. Unlike the NES, the Game Boy doesn't support software envelopes on its tone generators without restarting the note, and restarting the note every frame produces the buzzy, underwater sound you hear.

Quote:
I have a midi of the music but don't know how to write a midi player on the GBA.

It involves interpreting the Standard MIDI File format (ask Google) and sending sample playback commands to AAS or to whatever other sound player you choose.

And you may have to tell SoX to discard "extra information" when converting a file.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.