From 642a0e99cfb4aeaa71cc1ac51739608ef6225b99 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 11 Sep 2016 15:49:18 -0400 Subject: js/vendor/StartAudioContext.js --- env.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'env.js') diff --git a/env.js b/env.js index 04fb6fb..ddfef4a 100644 --- a/env.js +++ b/env.js @@ -23,6 +23,18 @@ var environment = (function(){ environment.ready = function(){ environment.build() environment.bind() + if (is_mobile) { + environment.request_audio_context() + } + } + environment.request_audio_context = function(){ + var element = $("
", {"id" : "MobileStart"}).appendTo("body") + var button = $("
").attr("id", "Button").text("Enter").appendTo(element) + StartAudioContext.setContext(Tone.context) + StartAudioContext.on(button) + StartAudioContext.onStarted(function(){ + element.remove() + }) } environment.build = function(){ environment.scale() -- cgit v1.2.3-70-g09d2