getGlobalPan
Get the current stereo pan of the master bus, as set by setGlobalPan.
getGlobalPan(): number;
Parameters
This method takes no parameters.
Returns
number: the master pan, from -1 (full left) to 1 (full right). 0 is centre.
Example
import { SoundHub } from 'soundhub';
const soundHub = new SoundHub();
await soundHub.loadSound('music', '/audio/theme.mp3');
soundHub.setGlobalPan(0.25);
console.log(soundHub.getGlobalPan()); // 0.25
Good to know
- The value is read straight from the master stereo panner node, so it reflects what is applied to the mix.
- Before any call to
setGlobalPanit returnsdefaultPanfrom the hub config,0when not set. - Per-sound pans from
setPanare not included.
See also
setGlobalPan: change the master pan.getPreviousMasterPan: the value before the last change.