Author
|
Topic: wav2gba - Can't get it to work. (Read 2 times)
|
RadioShadow
Guest
|
|
« on: April 20, 2008, 05:52:51 pm » |
|
I found this tool which apparently turns wav sounds into GBA wave structure. http://www.gbadev.org/tools.php?showinfo=188The only problem is, all I can get the program to do is play the wav file. It doesn't seem to convert it? I'm most likely inserting the instruction wrong in command line or just not using it correctly. Anyone able to help me figure out how it works? The readme file isn't that clear and it is confusing me. What I'm, trying to do is replace the Japanese voices in Gyakuten Saiban 3 with the English voices from the NDS version. I'm using the rips which are hosted here: http://www.court-records.net/audio.htm which I've started to convert to .wav. Once I get the binary data, using Sappy 1.1, I just got to locate the pointers, change them to where the new wave structure data is in the rom (unless there is a better tool which can locate the pointers). Just can't get the wav data converted. An alternative that did occur to me is I could try importing the voice data from the NDS version into the GBA version, providing the data is the same and the GBA can read the data. In fact, I wonder if they rerecorded the Japanese voices for better quality or just imported the Japanese voice data straight from the GBA rom?
|
|
|
|
Solid One
Guest
|
|
« Reply #1 on: April 22, 2008, 06:58:48 am » |
|
probably it's something related to WAV file specs. accordingly to the readme, it must be in 8 bits, and probably only in 22khz. ah, and windows sound recorder (sndrec32) won't help. you'll need another program for converting wave/mp3 files to wave.
|
|
|
|
creaothceann
Guest
|
|
« Reply #2 on: April 22, 2008, 07:51:02 am » |
|
Winamp disk writer + Cool Edit / Goldwave, ...
|
|
|
|
Karatorian
Guest
|
|
« Reply #3 on: April 22, 2008, 08:23:44 pm » |
|
I recommend SoX, the swiss army knife of sound formats. It's command line, but it does pretty much everything. I don't know the details of the GBA sound format, but it wouldn't surprize me if, given the proper raw format, SoX could transcode straight from MP3 (or a myraid of other formats) to GBA. Edit:I did some checking and the GBA's direct sound format is raw single channel eight bit signed. So you could use SoX to go straight from whatever format you have on hand to GBA format in a single step. The GBA supports a variety of sample rates, so you'll have to figure out what rate whatever sound engine you intend to use the converted samples with expects and/or supports. Best of luck, sound and music always give a hack that special touch.
|
|
« Last Edit: April 22, 2008, 08:37:39 pm by Karatorian »
|
|
|
|
RadioShadow
Guest
|
|
« Reply #4 on: April 23, 2008, 03:02:30 pm » |
|
The site says MP3 can be support but running the tool in Command Line gives a list of supported files and MP3 is not on the list. Strange.
But I can easily convert the MP3 into WAV and convert the WAV format using SOX to RAW GBA format.
I'm just getting my head around the command from the readme:
" performs the same format translation, but also changes the audio sam- pling rate & sample size, down-mixes to mono, and applies the vol and dither effects.
sox -r 8000 -u -1 -c 1 voice-memo.raw voice-memo.wav"
" The number of bits used to store each sample. Most popular are 8-bit (one byte) and 16-bit (two bytes). (Since many now-common sound formats were invented when most computers used a 16-bit word, two bytes is often called a ‘word’, but since current per- sonal computers overwhelmingly have 32-bit or 64-bit words, this usage is confusing, and is not used in the SoX documentation.)"
So the RAW GBA DATA will need to be:
- RAW Format - Single Channel (Mono) - Eight Bit Signed - Sample Rate (Need to look into but for now, 12000Hz)
So in the command line I think I put this:
sox -r 12000 -s -1 -c 1 po.wav po.wav
sox is the command to run the program. -r is the rate. -s means to make signed. -1 is the 8-bit (one byte) for the rate sample (I think). -c is the channel to use (mono) and the file input and output.
I think that is correct but could someone confirm that please?
|
|
|
|
Karatorian
Guest
|
|
« Reply #5 on: April 24, 2008, 12:14:44 am » |
|
You've almost got it right, the "-1" sbould be "-b" instead, for byte size samples. Also, SoX applies options appearing before the input filename as appying to the input, and options appearing before the output filename (i.e. after the input filename) apply to the output file. Finally, if you tell it to save it as a ".wav" file, it'll put a header on, which whould needlessly complicate things, so use ".raw" instead. (Alternatively, you could use the ".sb" psudoformat, which is raw signed byte data.)
The proper command should be: sox po.wav -r 12000 -s -b -c 1 po.raw or sox po.wav -r 12000 -c 1 po.sb
I know it's somewhat confusing, but really powerful tools tend to be.
MP3 support requires either the libmad (for decoding) and/or libmp3lame (for encoding) libraries and may not work except under un*x. (SoX's documentation, other than the man page, is pretty poor.)
|
|
|
|
RadioShadow
Guest
|
|
« Reply #6 on: April 25, 2008, 10:28:35 am » |
|
Thanks for you're help Karatorian. Just got to figure out how to add the data to the rom.
Using Sappy, I can locate where the header pointer is (xxxxxx08). It also tells you where the first track (in my case the voice data) is stored. There's also this voice pointer/location (unsure which) and it seems to be the same for each sound file. I've no idea what this does and if it requires any change.
Well I put the converted data at the end of the rom and changed the header pointer. The game just froze and made a horrible noise. XD
Either I'm not adding it correctly or I need to change the sample rate the game uses (which is going to be fun finding out). Something I'll have to look at this weekend.
|
|
|
|
Karatorian
Guest
|
|
« Reply #7 on: April 25, 2008, 04:19:18 pm » |
|
One way to tell if you're interpreting the headers correctly is to attempt to rip the existing audio. Once you've extracted the audio from the game, try to convert it to something you can playback on your computer. Basically, the SoX options would be the reverese of what I give above. You'll have to guess at the rate, but it should work anyway.
Having your data in the wrong sample rate won't turn your sounds into horrible noises. Instead, they'll just be faster or slower than expected. Chances are, you have some other problem.
|
|
|
|
RadioShadow
Guest
|
|
« Reply #8 on: April 25, 2008, 06:20:27 pm » |
|
Well it seems I've been editing the wrong stuff. XD
In fact, Sappy can dump the RAW file data without the 8 bit header. ^^
This means I can easily locate where the RAW data is being stored in the ROM. The 8 bit header is before the RAW data and the pointer can easily be located and changed. I wonder if I need to edit any of the header stuff?
If I figured this out right, I put the same header for the sound data to be changed in a different location. Place the new RAW data after the header and change the pointer locating to the new data. I'll try that out tommorow.
|
|
|
|
|