mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 22:12:48 -05:00
fix beatsToSec function (was getting millis)
This commit is contained in:
parent
6948968a85
commit
03d78a203b
1 changed files with 5 additions and 1 deletions
|
@ -128,10 +128,14 @@ AudioPlayer.prototype.waitForBeats = function (beats) {
|
|||
return new Promise(function (resolve) {
|
||||
setTimeout(function () {
|
||||
resolve();
|
||||
}, ((60 / storedContext.audioEngine.currentTempo) * 1000 * beats));
|
||||
}, storedContext.beatsToSec(beats) * 1000);
|
||||
});
|
||||
};
|
||||
|
||||
AudioPlayer.prototype.beatsToSec = function (beats) {
|
||||
return (60 / this.audioEngine.currentTempo) * beats;
|
||||
};
|
||||
|
||||
AudioPlayer.prototype.stopAllSounds = function () {
|
||||
// stop drum notes
|
||||
// for (var i = 0; i<this.drumSamplers.length; i++) {
|
||||
|
|
Loading…
Reference in a new issue