ADPCM sample
ADPCM sample
so i was trying to play an ADPCM sample... but without success...
according to gbatek it's IMA-ADPCM, but so i converted a 44khz 16bit mono sample, to IMA-ADPCM (i tried using the ACM functions from winapi, and i tried generating an IMA-APDCM.wav and stripping the header out)
both are sounding poorly on DS.... so what i'm missing? the DS ima-adpcm is different? and if so there's some tool or code (code would be better, but a program that can convert a raw sample to adpcm would be nice enough)....
or i need to modify something related to the header in order to get it working on DS?
according to gbatek it's IMA-ADPCM, but so i converted a 44khz 16bit mono sample, to IMA-ADPCM (i tried using the ACM functions from winapi, and i tried generating an IMA-APDCM.wav and stripping the header out)
both are sounding poorly on DS.... so what i'm missing? the DS ima-adpcm is different? and if so there's some tool or code (code would be better, but a program that can convert a raw sample to adpcm would be nice enough)....
or i need to modify something related to the header in order to get it working on DS?
Re: ADPCM sample
ok, it seems that SOX, got the thing done
http://sourceforge.net/projects/sox/
so, i will try to check it's source and understand the differences
http://sourceforge.net/projects/sox/
so, i will try to check it's source and understand the differences
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: ADPCM sample
Cool, what parameters did you use for sox to get the correct format out?
I've toyed with the idea of including sox with the toolchains for audio manipulation in the past but never really got up the time or motivation to do it properly.
I've toyed with the idea of including sox with the toolchains for audio manipulation in the past but never really got up the time or motivation to do it properly.
Re: ADPCM sample
justWinterMute wrote:Cool, what parameters did you use for sox to get the correct format out?
I've toyed with the idea of including sox with the toolchains for audio manipulation in the past but never really got up the time or motivation to do it properly.
Code: Select all
sox Input.wav output.ima
and it works..
but i used it to convert the samples of a .PAT file to generate a very optimized ".pDS" file that uses the minimum frequency/encoded in ADPCM to save space and so i can use some FreePAT patches on DS... then for that (i could had piped out) but i saved the RAW "16bit ??khz mono" wave into a ".s16" file and did
Code: Select all
sox.exe -G -c 1 -r ????? RawSample.s16 -r 22050 AdpcmSample.ima
and so i kinda liked the result.
http://jafile.com/uploads/mysoft/Freeba ... _rhyme.nds
Re: ADPCM sample
I just downloaded sox and tried this with a longer sample (music) and it sounded pretty distorted on the DS, so perhaps there's still a setting to discover...
Donate to devkitPro - help us stay alive!
Re: ADPCM sample
heh.... then i will do more tests later.. but be sure to set the output as MONO, because if you generate a stereo sound, it will interleave the Left/Right channels... and obviously that will not work for DS, since DS expect each channel isolated...fincs wrote:I just downloaded sox and tried this with a longer sample (music) and it sounded pretty distorted on the DS, so perhaps there's still a setting to discover...
so perhaps the closest to correct setting is....
Code: Select all
sox -G Input.wav -b 16 -c 1 -r 32000 -t ima Output.ima
Re: ADPCM sample
man, that sounds terrible and poppy in desmume.
be aware that if you have a looping sample, there is some kind of quirk where the loop point needs to be a multiple of 16 or something like that. pay close attention, and look it up on gbatek. you may need to resample the sound to a funny samplerate so that you can have the loop land on the right spot.
be aware that if you have a looping sample, there is some kind of quirk where the loop point needs to be a multiple of 16 or something like that. pay close attention, and look it up on gbatek. you may need to resample the sound to a funny samplerate so that you can have the loop land on the right spot.
Re: ADPCM sample
if you're talking about my .NDS, yes it works crap on desmume for 2 reasonszeromus wrote:man, that sounds terrible and poppy in desmume.
be aware that if you have a looping sample, there is some kind of quirk where the loop point needs to be a multiple of 16 or something like that. pay close attention, and look it up on gbatek. you may need to resample the sound to a funny samplerate so that you can have the loop land on the right spot.
1) i'm starting and stopping the adpcm sound several times between samples.... and desmume delays the ADPCM start too much, (not to mention it's using too much cpu i think) and so it doesnt do a good emulation of that...
2) i use the hblank timer to wait for the events, (to not waste a timer, because this code suppose to run silently in background, since it's part of the freebasic runtime lib, and so i decided that timer() function will be using hblank... but so it works fine in no$GBA and on the Real DS.. then it's fine (apparently unchecking the "Advanced Bus level" option, make the hblank runs better)
also yeah about the loop, it must be word aligned, and there's some constraints on the size that is something i didnt really got the purpose of that.... but i did it right like was mentioned on gbatek...
and anyway, many people playing ADPCM sounds were using 22khz, probabily to save space... but turns out that for now with SOX only a sound playing at 22khz is sounding reasonable good (depend on the sound), this rhyme is one example of a sound that plays exact like the PCM version.. and i'm reasearching to make a proper ADPCM generator for DS, to fix all those issues yeah
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: ADPCM sample
For what it's worth, Damien Yerrick released a tool for creating compressed audio for GBA a few years ago. His source code for 8ad includes a tool which can convert wav files to the DS ima format although you'll need to do some editing and recompiling. There are instructions in the source archive.
http://www.pineight.com/gba/#8ad
http://www.pineight.com/gba/#8ad
Who is online
Users browsing this forum: No registered users and 2 guests