Skip to content

Instantly share code, notes, and snippets.

@YohannParis
Created May 23, 2024 19:13
Show Gist options
  • Save YohannParis/d4ebbc697cbfe78887a058affad4652d to your computer and use it in GitHub Desktop.
Save YohannParis/d4ebbc697cbfe78887a058affad4652d to your computer and use it in GitHub Desktop.
Mario coin sound
/* From Mike Bostock
* https://x.com/mbostock/status/1765222176641437859
*/
c=new AudioContext(),g=c.createGain(),o=c.createOscillator(),G=g.gain,of=o.frequency,g.connect(c.destination),G.value=0.1,G.linearRampToValueAtTime(0,1),o.connect(g),o.type="square",of.setValueAtTime(988,0),of.setValueAtTime(1319,0.08),o.start(),o.stop(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment