Not sure if this is still being updated, but I would like to point out that the reason why the compressed cries sound so bad. While the compression does lower the sound quality a bit, there should not be any crackling/clipping sounds. It happens because the compression method is flawed. I found this out as I was making a tool for myself to mass import cries for new pokemons and was using a similar approach to compress them. :tongue-poke:
Below are the detail explainations if OP/anyone is interested (also refer to cry compression thread):
The compression works by writing each change between samples in a half-byte instead of actual sample in a full byte. It uses the half-byte to looks up a fixed table and determine the actual change in level. However, as half-byte is very limited (only 16 types of change), we have to compromise and use the closest change instead (as this tool does). It may not be very accurate but that how lossy compression works. This sounds all good in theory but here is the problem.
As the acual sample is limited by a byte, but each sample keeps applying this approximated change without question, the sound level can sometimes overflow/underflow. Basically, some samples will go over 0xFF or under 0x00 after the change and therefore jump to the opposite direction. That's why it makes these crackling sounds. It is still audible partly because the compression re-samples every block.
To fix this, you need to keep track of the sample value after each changes, and prevent it from overflowing/underflowing. I've tried it and that results in much better sound quality without those noises.
I think the compression can be pretty important when you want to include lots of pokemons in the rom, as the sizes of cries are huge and the compression can basically cut it by half. :disbelief:
Hope this is helpful. Also, thanks to this tool and the original cry compression thread, I've really learned a lot!
