[Flac-dev] pcspkr wave encoding
Jan Engelhardt
jengelh at computergmbh.de
Thu Aug 16 01:25:57 PDT 2007
On Aug 15 2007 15:21, Josh Coalson wrote:
>>
>> there is an interesting case when the FLAC encoder (using 1.2.0) is
>> given simple waves. Simple waves means: I have a list of {frequency,
>> duration, pause} tuples that define the monophonic tune. In other
>> words, exactly one frequency is played at a time.
>>
>> Now this is what happens when encoding to FLAC:
>>
>> $ flac -8 ihold-sine.wav
>> ihold-sine.wav: wrote 2422225 bytes, ratio=0.353
>>
>> $ flac -8 ihold-square.wav
>> ihold-square.wav: wrote 5573016 bytes, ratio=0.813
>>
>> As soon as square waves are mixed in, the FLAC compression ratio
>> drops rapidly up to the point where it equals the ratio of typical
>> day-to-day music.
>>
>> While I do not request FLAC to compress the wave back to its original
>> 20KB, I think it could improve on the sine and square compression.
>> Are there any plans to address this?
>
>hard to say what is happening without seeing the files. FLAC does
>have a run-length encoding mode so with pure square waves it is
>possible to get very high compression with a custom encoder.
http://jengelh.hopto.org/ihold-sine.wav
http://jengelh.hopto.org/ihold-square.wav
have fun,
Jan
--
More information about the Flac-dev
mailing list