Skip to content

raylib.SetMusicPan

JoeStrout edited this page Oct 18, 2026 · 4 revisions

Set pan for music

Parameters

Parameter Default Value Note
music
pan 0.0

Return value

None.

Notes

SetMusicPan controls how loud the music plays in the left speaker versus the right. The pan parameter ranges from -1.0 (full left) to 1.0 (full right). A value of 0.0 means balanced (center).

(Note that this changed in November 2025; before that, the sign ranged from 0=right to 1=left. So be careful when working from older code examples.)

Example

raylib.InitAudioDevice
music = raylib.LoadMusicStream("resources/music.ogg")
raylib.SetMusicPan music, 1.0  // pan right
raylib.PlayMusicStream music
raylib.UnloadMusicStream music
raylib.CloseAudioDevice

Clone this wiki locally