Live data from Hacker News

Generate raw WAV output by hooking malloc and read

github.com

1–10 of 26 posts

Re: Generate raw WAV output by hooking malloc and read

#4
To the tune of Sound of Silence by Simon & Garfunkel:

    Hello malloc() my old friend,
    I've come for mem'ry once again,
    Because a pointer silently creeping,
    Filled buffer that I was keeping,
    And the signal that I trapped was a bus error.
    Didn't care.
    Because I still... have malloc()

    There were pages that I missed.
    My OS had sent them to disk.
    Try my best to not hit swap,
    Looking for data I could safely drop,
    I compressed some bits that I kept stored in place
    Freed some space.
    But then I still... used malloc().

Re: Generate raw WAV output by hooking malloc and read

#9

This seems cool, though I don't entirely understand it. "Generates raw WAV output by hooking malloc() and read()." What does that mean exactly?

It uses hooking to intercept calls to malloc() and read(), calls the real functions, generates a square wave whose frequency is based on the size of the operation, dumps the generated sound data to WAV, returns the output of the real function calls.

Re: Generate raw WAV output by hooking malloc and read

#10
post #4

To the tune of Sound of Silence by Simon & Garfunkel: Hello malloc() my old friend, I've come for mem'ry once again, Because a pointer silently creeping, Filled buffer that I was keeping, And the signal that I trapped was a bus error. Didn't care. Because I still... have malloc() There were pages that I missed. My OS had sent them to disk. Try my best to not hit swap, Looking for data I could safely drop, I compresse…

[deleted]
Post reply on HN