scratch-vm/audioWorker.js
2016-09-13 17:52:54 -04:00

29 lines
No EOL
524 B
JavaScript

function AudioWorker () {
}
AudioWorker.prototype.playSound = function (soundNum) {
self.postMessage({
type: 'audio',
method: 'playSound',
value: soundNum
});
};
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;