From c54fc0f1546f4e926b0feaa6da3fd19c24e3eb78 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 10 Jan 2017 18:03:15 -0500 Subject: [PATCH] comments --- src/effects/PanEffect.js | 2 +- src/index.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/effects/PanEffect.js b/src/effects/PanEffect.js index daf8107..430da92 100644 --- a/src/effects/PanEffect.js +++ b/src/effects/PanEffect.js @@ -2,7 +2,7 @@ A Pan effect --100 puts the audio on the left channel, 0 centers it, 100 makes puts it on the right. +-100 puts the audio on the left channel, 0 centers it, 100 puts it on the right. Clamped -100 to 100 diff --git a/src/index.js b/src/index.js index 22967b9..c078f0d 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,13 @@ var ADPCMSoundLoader = require('./ADPCMSoundLoader'); var InstrumentPlayer = require('./InstrumentPlayer'); var DrumPlayer = require('./DrumPlayer'); +/* Audio Engine + +The Scratch runtime has a single audio engine that handles global audio properties and effects, +and creates the instrument player and a drum player, used by all play note and play drum blocks + +*/ + function AudioEngine () { // create the global audio effects @@ -45,6 +52,15 @@ AudioEngine.prototype.createPlayer = function () { return new AudioPlayer(this); }; +/* Audio Player + +Each sprite has an audio player +Clones receive a reference to their parent's audio player +the audio player currently handles sound loading and playback, sprite-specific effects +(pitch and pan) and volume + +*/ + function AudioPlayer (audioEngine) { this.audioEngine = audioEngine;