scratch-vm/audioWorker.js

29 lines
524 B
JavaScript
Raw Normal View History

function AudioWorker () {
}
AudioWorker.prototype.playSound = function (soundNum) {
self.postMessage({
type: 'audio',
method: 'playSound',
value: soundNum
});
};
2016-09-13 17:52:54 -04:00
AudioWorker.prototype.stopAllSounds = function () {
self.postMessage({
type: 'audio',
method: 'stopAllSounds'
});
};
AudioWorker.prototype.playNoteForBeats = function (note, beats) {
self.postMessage({
type: 'audio',
method: 'playNoteForBeats',
note: note,
beats: beats
});
};
module.exports = AudioWorker;