This commit is contained in:
Eric Rosenbaum 2017-01-10 18:03:15 -05:00
parent 703502cfbb
commit c54fc0f154
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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;