mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
lint
This commit is contained in:
parent
7b179546ed
commit
80764f053d
1 changed files with 22 additions and 15 deletions
|
@ -19,7 +19,8 @@ function AudioEngine () {
|
|||
|
||||
// drum sounds
|
||||
|
||||
// var drumFileNames = ['high_conga', 'small_cowbell', 'snare_drum', 'splash cymbal'];
|
||||
// var drumFileNames = ['high_conga', 'small_cowbell',
|
||||
// 'snare_drum', 'splash cymbal'];
|
||||
// this.drumSamplers = this._loadSoundFiles(drumFileNames);
|
||||
|
||||
// sound urls - map each url to its tone.sampler
|
||||
|
@ -27,14 +28,18 @@ function AudioEngine () {
|
|||
|
||||
// soundfont setup
|
||||
|
||||
// instrument names used by Musyng Kite soundfont, in order to match scratch instruments
|
||||
this.instrumentNames = ['acoustic_grand_piano', 'electric_piano_1', 'drawbar_organ', 'acoustic_guitar_nylon',
|
||||
'electric_guitar_clean', 'acoustic_bass', 'pizzicato_strings', 'cello', 'trombone', 'clarinet'];
|
||||
// instrument names used by Musyng Kite soundfont, in order to
|
||||
// match scratch instruments
|
||||
this.instrumentNames = ['acoustic_grand_piano', 'electric_piano_1',
|
||||
'drawbar_organ', 'acoustic_guitar_nylon', 'electric_guitar_clean',
|
||||
'acoustic_bass', 'pizzicato_strings', 'cello', 'trombone', 'clarinet'];
|
||||
|
||||
Soundfont.instrument(Tone.context, this.instrumentNames[0]).then(function (inst) {
|
||||
Soundfont.instrument(Tone.context, this.instrumentNames[0]).then(
|
||||
function (inst) {
|
||||
this.instrument = inst;
|
||||
this.instrument.connect(Tone.Master);
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
AudioEngine.prototype.playSound = function (soundNum) {
|
||||
|
@ -63,7 +68,9 @@ AudioEngine.prototype.getSoundDuration = function (url) {
|
|||
};
|
||||
|
||||
AudioEngine.prototype.playNoteForBeats = function(note, beats) {
|
||||
this.instrument.play(note, Tone.context.currentTime, {duration : Number(beats)});
|
||||
this.instrument.play(
|
||||
note, Tone.context.currentTime, {duration : Number(beats)}
|
||||
);
|
||||
};
|
||||
|
||||
AudioEngine.prototype.playDrumForBeats = function(drumNum, beats) {
|
||||
|
|
Loading…
Reference in a new issue