diff --git a/HISTORY.md b/HISTORY.md index 6dad76e5..3de11e4a 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -14,6 +14,7 @@ ### 2022-03-03 * SciSnap2 extension update (FFT), thanks, Eckart! +* threads: removed experimental code ### 2022-03-02 * gui: never close a dev-warning diff --git a/snap.html b/snap.html index 416420b0..f08ef42e 100755 --- a/snap.html +++ b/snap.html @@ -17,7 +17,7 @@ - + diff --git a/src/threads.js b/src/threads.js index 05e9b00d..8f92174b 100644 --- a/src/threads.js +++ b/src/threads.js @@ -64,7 +64,7 @@ SnapExtensions, AlignmentMorph, TextMorph, Cloud, HatBlockMorph*/ /*jshint esversion: 6*/ -modules.threads = '2022-March-01'; +modules.threads = '2022-March-03'; var ThreadManager; var Process; @@ -3413,48 +3413,6 @@ Process.prototype.decodeSound = function (sound, callback) { this.pushContext(); }; -Process.prototype.decodeSpectrum = function (sound, callback) { - // private - callback is optional and invoked with sound as argument - var base64, binaryString, len, bytes, i, arrayBuffer, audioCtx, analyzer; - - if (sound.audioBuffer) { - return (callback || nop)(sound); - } - if (!sound.isDecoding) { - base64 = sound.audio.src.split(',')[1]; - binaryString = window.atob(base64); - len = binaryString.length; - bytes = new Uint8Array(len); - for (i = 0; i < len; i += 1) { - bytes[i] = binaryString.charCodeAt(i); - } - arrayBuffer = bytes.buffer; - audioCtx = Note.prototype.getAudioContext(); - sound.isDecoding = true; - - analyser = audioCtx.createAnalyser(); // +++ - analyser.fftSize = 256; - var bufferLength = analyser.frequencyBinCount; - var dataArray = new Uint8Array(bufferLength); - analyser.getByteFrequencyData(dataArray); - - - audioCtx.decodeAudioData( - arrayBuffer, - buffer => { - sound.audioBuffer = buffer; - sound.isDecoding = false; - }, - err => { - sound.isDecoding = false; - this.handleError(err); - } - ); - } - this.pushContext('doYield'); - this.pushContext(); -}; - Process.prototype.encodeSound = function (samples, rate) { // private var rcvr = this.blockReceiver(),