Skip to content

Instantly share code, notes, and snippets.

@scshepard
Forked from xem/gist:670dec8e70815842eb95
Last active August 29, 2015 14:14
Show Gist options
  • Save scshepard/814f3a9c70d58950a6ef to your computer and use it in GitHub Desktop.
Save scshepard/814f3a9c70d58950a6ef to your computer and use it in GitHub Desktop.
<!-- solution 1, 117b, inspired by http://www.p01.org/releases/140bytes_music_softSynth/ -->
<button onclick="new Audio('data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU'+Array(1e3).join(123)).play()">Beep</button>
<!-- Solution 2, 124b, inspired by http://xem.github.io/chip8/c8.html -->
<button onclick="with(o=(A=new AudioContext).createOscillator()){connect(A.destination);start(0);s=stop||noteOff;setTimeout('o.stop(0)',500)}">Boop</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment