Hacker News new | past | comments | ask | show | jobs | submit login

> I wonder if using RLE encoding would not have been but vastly simpler and more compact...

No, mate - it wouldn't. Don't be confused by the "printf"-dump; the Python script processed it into pairs of (frequency,delay). That is, when you see...

    989 Hz @ 15209
    989 Hz @ 15213
    989 Hz @ 15218
    784 Hz @ 15222
    784 Hz @ 15226
...the data actually generated are:

    (989, 15222-15209), 
    (784,  ... -15222),
Simply put: RLE can't do anything on them. The repetition has already been "cleaned out".

I wouldn't have gone to Huffman compression if I had a simpler choice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: