Skip to content

Instantly share code, notes, and snippets.

@geelen
Forked from anonymous/index.html
Created December 19, 2012 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geelen/4334811 to your computer and use it in GitHub Desktop.
Save geelen/4334811 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<script>
(function ( window, document ) {
// Pinched domready
// http://www.dustindiaz.com/smallest-domready-ever/
var readyState = function ( fn ) {
if( /in/.test( document.readyState ) ) {
window.setTimeout( function () {
readyState( fn );
}, 9 );
} else {
fn();
}
},
init = function () {
var context = new webkitAudioContext(),
oscillator = context.createOscillator();
oscillator.connect(context.destination); // Connect to speakers
oscillator.noteOn(0); // Start generating sound immediately
oscillator.frequency.value = 200;
};
// DOM ready
readyState( init );
}( this, this.document ));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment