mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-01-03 11:35:49 -05:00
comments
This commit is contained in:
parent
703502cfbb
commit
c54fc0f154
2 changed files with 17 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
A Pan effect
|
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
|
Clamped -100 to 100
|
||||||
|
|
||||||
|
|
16
src/index.js
16
src/index.js
|
@ -14,6 +14,13 @@ var ADPCMSoundLoader = require('./ADPCMSoundLoader');
|
||||||
var InstrumentPlayer = require('./InstrumentPlayer');
|
var InstrumentPlayer = require('./InstrumentPlayer');
|
||||||
var DrumPlayer = require('./DrumPlayer');
|
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 () {
|
function AudioEngine () {
|
||||||
|
|
||||||
// create the global audio effects
|
// create the global audio effects
|
||||||
|
@ -45,6 +52,15 @@ AudioEngine.prototype.createPlayer = function () {
|
||||||
return new AudioPlayer(this);
|
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) {
|
function AudioPlayer (audioEngine) {
|
||||||
|
|
||||||
this.audioEngine = audioEngine;
|
this.audioEngine = audioEngine;
|
||||||
|
|
Loading…
Reference in a new issue