Skip to main content

setGlobalPan

setGlobalPan(value: number): void;

Set the global stereo pan for all sounds. The value ranges from -1 (full left) to 1 (full right), with 0 being center. Unlike setPan which pans a single sound, this affects all sounds simultaneously.


Example

await soundManager.loadSounds([{ id: 'helicopter', url: 'helicopter.mp3' }]);

soundManager.play('helicopter', { loop: true });

// Pan all sounds to the left
soundManager.setGlobalPan(-0.5);

// Center
soundManager.setGlobalPan(0);

// Reset to default
soundManager.resetGlobalPan();
Global Pan Position
Center
LCR
Try it: Unlike setPan which pans a single sound, setGlobalPan pans all sounds at once. This is useful for a master balance control.