Skip to main content

getPreviousMasterPan

getPreviousMasterPan(): number;

Get the previous master pan value before it was reset. This is useful when you want to restore the pan to its previous state after a temporary change or reset.

Return TypeDescription
numberThe previous master pan value (between -1 and 1)

Example

soundManager.setGlobalPan(0.5); // Pan right

// Later, reset the pan
soundManager.resetGlobalPan();

// Restore the previous pan
soundManager.setGlobalPan(soundManager.getPreviousMasterPan()); // Restores to 0.5