kopia lustrzana https://github.com/backface/turtlestitch
removed experimental code from threads.js
rodzic
ce63da9cef
commit
cebe370de0
|
@ -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
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<script src="src/symbols.js?version=2021-03-03"></script>
|
||||
<script src="src/widgets.js?version=2021-17-09"></script>
|
||||
<script src="src/blocks.js?version=2022-03-01"></script>
|
||||
<script src="src/threads.js?version=2022-03-01"></script>
|
||||
<script src="src/threads.js?version=2022-03-03"></script>
|
||||
<script src="src/objects.js?version=2022-03-01"></script>
|
||||
<script src="src/scenes.js?version=2021-11-24"></script>
|
||||
<script src="src/gui.js?version=2022-03-02"></script>
|
||||
|
|
|
@ -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(),
|
||||
|
|
Ładowanie…
Reference in New Issue