From 1a783fbad5b281e656faf1e9aa9cde74127b53dc Mon Sep 17 00:00:00 2001 From: William Ferguson <wferguson@scottlogic.com> Date: Tue, 22 Jul 2014 15:43:51 +0100 Subject: [PATCH 1/2] Fix for mobile devices using deprecated noteOn. --- js/Scratch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/Scratch.js b/js/Scratch.js index 653796f..1f6cbd9 100644 --- a/js/Scratch.js +++ b/js/Scratch.js @@ -113,7 +113,7 @@ function Scratch(project_id) { var isource = runtime.audioContext.createBufferSource(); isource.buffer = ibuffer; isource.connect(runtime.audioContext.destination); - isource.noteOn(0); + isource.start(); iosAudioActive = true; } }); From 1bc446c1474e8443df345e8f6728acde222e1194 Mon Sep 17 00:00:00 2001 From: William Ferguson <wferguson@scottlogic.com> Date: Fri, 25 Jul 2014 10:39:33 +0100 Subject: [PATCH 2/2] Fix: PID 20399371 19668483 24897457 Issue https://github.com/WPFerg/scratch-html5/issues/12 https://github.com/WPFerg/scratch-html5/issues/9 https://github.com/WPFerg/scratch-html5/issues/3 --- js/primitives/SoundPrims.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/primitives/SoundPrims.js b/js/primitives/SoundPrims.js index d1f4ce1..fae4bbe 100644 --- a/js/primitives/SoundPrims.js +++ b/js/primitives/SoundPrims.js @@ -39,7 +39,7 @@ SoundPrims.prototype.addPrimsTo = function(primTable) { var playSound = function(snd) { if (snd.source) { // If this particular sound is already playing, stop it. - snd.source.noteOff(0); + snd.source.disconnect(); snd.source = null; } @@ -62,7 +62,7 @@ var playSound = function(snd) { window.setTimeout(snd.source.finished, snd.buffer.duration * 1000); // Add the global list of playing sounds and start playing. runtime.audioPlaying.push(snd); - snd.source.noteOn(0); + snd.source.start(); return snd.source; }; @@ -108,7 +108,7 @@ var stopAllSounds = function() { runtime.audioPlaying = []; for (var s = 0; s < oldPlaying.length; s++) { if (oldPlaying[s].source) { - oldPlaying[s].source.noteOff(0); + oldPlaying[s].source.disconnect(); oldPlaying[s].source.finished(); } }