kopia lustrzana https://github.com/backface/turtlestitch
keep microphone always on when running Snap! locally
otherwise users need to re-allow microphone usage every time the block is eveluated again laterpull/89/head
rodzic
ea25dad812
commit
63a0f343a6
|
@ -52,6 +52,7 @@
|
|||
* AudioComp lib: support Safari
|
||||
* removed "loudness / microphone" block from AudioComp lib (turned into primitive)
|
||||
* new "microphone" reporter in Sensing for getting volume, signals and frequencies
|
||||
* Objects: keep microphone always on when running Snap! locally
|
||||
|
||||
### 2019-03-05
|
||||
* GUI: added "globe" icon to language menu item
|
||||
|
|
|
@ -8885,6 +8885,7 @@ function Microphone() {
|
|||
this.isReady = false;
|
||||
|
||||
// idling control:
|
||||
this.isAutoStop = (location.protocol !== 'file:');
|
||||
this.lastTime = Date.now();
|
||||
}
|
||||
|
||||
|
@ -8971,7 +8972,7 @@ Microphone.prototype.stepAudio = function (event) {
|
|||
freqBufLength = this.analyser.frequencyBinCount,
|
||||
dataArray = new Uint8Array(freqBufLength);
|
||||
|
||||
if ((Date.now() - this.lastTime) > 5000) {
|
||||
if (this.isAutoStop && ((Date.now() - this.lastTime) > 5000)) {
|
||||
this.stop();
|
||||
return;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue