getMasterSpatialPosition
Get the position last given to the master panner.
getMasterSpatialPosition(): { x: number; y: number; z: number };
Parameters
This method takes no parameters.
Returns
{ x: number; y: number; z: number }: the master position, { x: 0, y: 0, z: 0 } until you set one. It never returns null.
Example
import { SoundHub } from 'soundhub';
const soundHub = new SoundHub();
soundHub.getMasterSpatialPosition(); // { x: 0, y: 0, z: 0 }
soundHub.setMasterSpatialPosition(4, 0, -2);
soundHub.getMasterSpatialPosition(); // { x: 4, y: 0, z: -2 }
Good to know
- It returns the stored object itself, not a copy. Read from it, but move the panner with
setMasterSpatialPosition. cleanupGlobalPanremoves the master panner but leaves this value as it was.resetMasterSpatialPositionsets it back to0, 0, 0.
See also
setMasterSpatialPosition: position the whole mix.getMasterSpatialOrientation: the direction of the master panner.getSpatialPosition: the position of one sound.