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 > Compression and Quality

#25220 - ProblemBaby - Wed Aug 18, 2004 11:41 pm

Ive two questions I will start with the quality question:
Ive made a wav-file that is about 1minute
16384hz, 8bit, mono.

When I listen to this in winamp it sounds much better then it does
when I listen to it in no$gba (not tried on hardware, but I think it will be the same), Its more noise.
The way Ive converted is that Ive loaded the data from a wav-file
and then subtract 128 for each sample.

Do winamp change the output in some way or am I doing something wrong when I convert or what is this about?? (Ive not done any compression)

the Compression question:
Iam trying do compress my music (at realtime) with quite bad results the best Ive commed up with will compress it with about 30-45% (lossless)
for a 8bit 16.384hz mono wav.
Ive heard of adpcm how much does it compress and is it lossless?
is there any other nice audio compression algorithms out there that is fast enough to be decoded in runtime?

My goal is to make it compressed to 1kb per second without much noise.
Should I stop dreaming or is this possible?

Thanks in advance!

#25226 - tepples - Thu Aug 19, 2004 1:46 am

ProblemBaby wrote:
Ive heard of adpcm how much does it compress and is it lossless?

Simple forms of ADPCM such as 8ad will give you great sounding audio at 4 bits per sample, taking about 6% of the CPU.

Quote:
is there any other nice audio compression algorithms out there that is fast enough to be decoded in runtime?

My goal is to make it compressed to 1kb per second without much noise. Should I stop dreaming or is this possible?

If you want Super NES quality music, you can do this with .mod/.xm/.s3m tracked formats. If you want vocals, you'll have to settle for GSM 06.10 at 18157 Hz: 3.75 KBytes per second, 50 percent CPU use.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25233 - DekuTree64 - Thu Aug 19, 2004 6:10 am

Long story short: don't bother with wave files if you have any sort of space constraint. Sequenced music is much smaller, even if you use uncompressed waves as samples. If you reserve a big chunk of your EWRAM, you can use ADPCM or GSM on the samples and decompress the ones you need for a song. That will of course limit the total size of the samples in a song, but it should be enough for most cases, and even more so when your total ROM size is so small.
Also, this post by Tepples about generating waves dynamically is good too (for me as well, because I've never messed around with synthesis stuff before).

Even if you do have vocals, you can still benefit from tracked music, by chopping out silent portions of the voice channel, and recycling any lyrics that repeat. And if you have full quality tracked instrumental music going on, you can get away with a lot more lossy compression on the vocals.
Of course, the hard part is getting your hands on the original vocals without instruments in the background...
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#25292 - tepples - Fri Aug 20, 2004 5:15 am

DekuTree64 wrote:
Of course, the hard part is getting your hands on the original vocals without instruments in the background...

If you have licensed a song or are covering a traditional song, then you most likely are performing the song yourself or are paying performers. This means you have the separate vocal track. The technique of storing the whole mix in GSM 06.10 applies mainly to licensing a recording (which is distinct from the underlying song), as Konami did in the Dance Dance Revolution series.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.