OGG: Fix for codebook waste
|Reported by:||SF/puntloos||Owned by:||fingolfin|
A detailed discussion thread about both issues is here:
In a nutshell:
--- Codebook waste: Every ogg file has a codebook of 4-12kbyte. On vorbis files of (say) 1 second of (say) 32kbps that would mean around 20% wasted space.
The way to fix this is to compile one huge source .wav file (or at least not one for every sample!) and encode this into one big vorbis file. After that all that's left is to implement some code to seek the right spot to play.
A useful side-effect is that people interested in the actual samples can just drag the resulting file into winamp and play.
--- Resampling issue: As I've come to understand it certain Lucasarts games use a strange frequency of 11111Hz instead of the usual 11025. When fed to vorbis, vorbis resamples and encodes, and appearantly vorbis isn't very good at resampling. 2 solutions present themselves:
1/ Use some other resampler before feeding the file to vorbis, Im sure there's opensource stuff out there. 2/ (my preferred solution). Just force/fake and write the temporary wav files as being 11025Hz. The result is that the samples will be played back sliiightly slower (0.7%) but unless this gives unfixable timing problems in the game I very strongly doubt anyone will notice. (or just make it optional, so the purists can choose to resample and lose a ton of quality :) )
Ticket imported from: #786569. Ticket imported from: feature-requests/125.
Change History (8)
comment:4 by , 20 years ago
|Summary:||Fix for codebook waste and resampling issues → OGG: Fix for codebook waste|