mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Add loudness block
This commit is contained in:
parent
106db6a024
commit
b4a94c266f
1 changed files with 7 additions and 1 deletions
|
@ -26,7 +26,8 @@ Scratch3SensingBlocks.prototype.getPrimitives = function () {
|
||||||
sensing_mousedown: this.getMouseDown,
|
sensing_mousedown: this.getMouseDown,
|
||||||
sensing_keypressed: this.getKeyPressed,
|
sensing_keypressed: this.getKeyPressed,
|
||||||
sensing_current: this.current,
|
sensing_current: this.current,
|
||||||
sensing_dayssince2000: this.daysSince2000
|
sensing_dayssince2000: this.daysSince2000,
|
||||||
|
sensing_loudness: this.getLoudness
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -125,6 +126,11 @@ Scratch3SensingBlocks.prototype.daysSince2000 = function () {
|
||||||
return mSecsSinceStart / msPerDay;
|
return mSecsSinceStart / msPerDay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Scratch3SensingBlocks.prototype.getLoudness = function () {
|
||||||
|
if (typeof this.runtime.audioEngine === 'undefined') return 0;
|
||||||
|
return this.runtime.audioEngine.getLoudness();
|
||||||
|
};
|
||||||
|
|
||||||
Scratch3SensingBlocks.prototype.getAttributeOf = function (args) {
|
Scratch3SensingBlocks.prototype.getAttributeOf = function (args) {
|
||||||
var attrTarget;
|
var attrTarget;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue