#174940 - DiscoStew - Fri Aug 06, 2010 5:39 pm
Now, if this is not applicable or messes up the audio too much, then we can forget it, but the other day, I was thinking about this idea.
With how the hardware deals with ADPCM playback, it loads the initial sample and step index before running the compressed data following. When it reaches the point where it loops back, the initial sample and step index are reloaded, and playback continues. Therefore, the only way to stream the audio via hardware is if you happen to reloop with the same sample and step index initially started.
So, what if before we compressed audio to the ADPCM format, after every certain block of data, we'd change the sample to be exactly like the initial sample? To go further, we could take the initial sample, and then the samples after a set data size, and then average them out, and write the average value in their places before compression.
To go even further, what about a variable-block method, where each block isn't the same size? As far as I can tell from GBATek, while the starting loop address shouldn't be changed, what about the length? If the length could be changed mid-playback, then we could take the idea above, and enhance with variable block compression, where the initial value will still be an average, but that average can be more based on samples actually close to the originals.
Anyone understand what I'm saying?
_________________
DS - It's all about DiscoStew
With how the hardware deals with ADPCM playback, it loads the initial sample and step index before running the compressed data following. When it reaches the point where it loops back, the initial sample and step index are reloaded, and playback continues. Therefore, the only way to stream the audio via hardware is if you happen to reloop with the same sample and step index initially started.
So, what if before we compressed audio to the ADPCM format, after every certain block of data, we'd change the sample to be exactly like the initial sample? To go further, we could take the initial sample, and then the samples after a set data size, and then average them out, and write the average value in their places before compression.
To go even further, what about a variable-block method, where each block isn't the same size? As far as I can tell from GBATek, while the starting loop address shouldn't be changed, what about the length? If the length could be changed mid-playback, then we could take the idea above, and enhance with variable block compression, where the initial value will still be an average, but that average can be more based on samples actually close to the originals.
Anyone understand what I'm saying?
_________________
DS - It's all about DiscoStew