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.

DS development > ADPCM - how to start from any sample?

#177736 - sverx - Mon Dec 31, 2012 11:58 am

[...well, not really DS related but I'll anyway probably try to implement that on DS too so why not asking here for some advices? ;) ]

I'm searching a feasible solution for this problem: I want to load some (mono) 16-bit audio samples in memory but I need them to use less memory, so ADPCM (4 bits per sample, so it'll use just 1/4 of space) is something I'm considering. Unfortunately AFAIK I can only start an ADPCM sample from the beginning, and if I don't use the hardware decoder and write my software decoder, I need to start the decoding from the beginning of the sample to be able to start the reproduction from the point I need.

So I was thinking about ADPCM-ing my sample in chunks. But I'm not completely fond of it. Any suggestions? Streaming isn't a feasible option...
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary

#177738 - PypeBros - Wed Jan 02, 2013 11:39 pm

could you live with an array of plain_sample[desired_pos/GRANULAR] that would seed the ADPCM decoding ?
_________________
SEDS: Sprite Edition on DS :: modplayer

#177739 - sverx - Thu Jan 03, 2013 10:18 am

mmm... well, I don't see any real advantage compared to having chunks of ADPCM encoded samples with a plain sample at the beginning... or do you mean something different?
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary