mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
target handles playnote via audio engine
This commit is contained in:
parent
5966a46bbd
commit
cb4209b27a
2 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,7 @@ Scratch3SoundBlocks.prototype.stopAllSounds = function (args, util) {
|
|||
Scratch3SoundBlocks.prototype.playNoteForBeats = function (args, util) {
|
||||
var note = Cast.toNumber(args.NOTE);
|
||||
var beats = Cast.toNumber(args.BEATS);
|
||||
return util.target.audioPlayer.playNoteForBeats(note, beats);
|
||||
return util.target.playNoteForBeats(note, beats);
|
||||
};
|
||||
|
||||
Scratch3SoundBlocks.prototype.playDrumForBeats = function (args, util) {
|
||||
|
|
|
@ -488,6 +488,11 @@ RenderedTarget.prototype.playSound = function (index) {
|
|||
RenderedTarget.prototype.setInstrument = function (num) {
|
||||
this.currentInstrument = num;
|
||||
};
|
||||
|
||||
RenderedTarget.prototype.playNoteForBeats = function (note, beats) {
|
||||
return this.runtime.audioEngine.playNoteForBeatsWithInst(note, beats, this.currentInstrument);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the human-readable name for this rendered target, e.g., the sprite's name.
|
||||
* @override
|
||||
|
|
Loading…
Reference in a new issue