Skip to content

Commit

Permalink
Support other browsers!
Browse files Browse the repository at this point in the history
  • Loading branch information
mtytel committed Mar 25, 2014
1 parent 0d3a7d1 commit 14779db
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/app.js
Expand Up @@ -10,13 +10,17 @@
lissa.BUFFER_SIZE = 1024;

lissa.init = function($) {
if(!('webkitAudioContext' in window)) {
alert("This uses the Web Audio API. Try opening it in Google Chrome.");
var context = null;
if (typeof AudioContext !== 'undefined')
context = new AudioContext();
else if (typeof webkitAudioContext !== 'undefined')
context = new webkitAudioContext();
else {
alert("Lissa Juice uses the Web Audio API, and your browser doesn't have it. :(");
return;
}

lissa.templates.init();
var context = new webkitAudioContext();
lissa.figure.init();
lissa.synth.init(lissa.BUFFER_SIZE);

Expand Down

0 comments on commit 14779db

Please sign in to comment.