@jmp242@sopuli.xyz
link
fedilink
English
31Y

There are apps that can make white noise while using 0 network really. If I was Spotify I’d write a library into the app that detected white noise and stopped streaming, and just turned on the local generator in their app.

@mindbleach@lemmy.world
link
fedilink
English
11Y

I’d have a Javascript one-liner producing white noise, except web audio is a Gordian knot of inscrutable identical-sounding types and contexts and maps and whateverthefuck. Documentation reads like they forgot to implement it and hoped nobody would notice.

How do you generate noise? Well you need a sink. How do I get a sink? Well you need an event. How do you get an event? Well you need a processor. How do you get a processor? Well you need a context. How do you get a context? Well you need a node. How do you get a node? Well you need a sink. I’m going to stab you now. Understandable.

@mindbleach@lemmy.world
link
fedilink
English
1
edit-2
1Y

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.

Create a post

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


  • 1 user online
  • 214 users / day
  • 604 users / week
  • 1.38K users / month
  • 4.49K users / 6 months
  • 1 subscriber
  • 7.41K Posts
  • 84.7K Comments
  • Modlog