• mindbleach@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Anyway it’s something like data:text/html,{script} ac = new AudioContext(); wn = ac.createScriptProcessor( 4096, 1, 1 ); wn.onaudioprocess = (e) => e.outputBuffer.getChannelData(0).forEach( (v,i,a) => a[i] = Math.random() ); wn.connect( ac.destination ); {/script} except with whatever dark wizardry makes output reach a speaker.

    Also I’m not sure .forEach works on whichever array-like type was chosen for audio channels. This stupid language has so many incompatible and incomplete array implementations.

    edit: And angle brackets on script and /script, because this stupid website fucked up its Markdown. Preventing random HTML strings in comments: excellent, necessary, obvious; it is not 1999 anymore. Doing so by deleting the entire goddamn thing as if you parsed it before removing it: DEEPLY TROUBLING.