mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
29 lines
No EOL
524 B
JavaScript
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; |