SoundPan()

Syntax

SoundPan(#Sound, Pan [, Channel])
Description
Sets the new pan value, in real-time, for the #Sound. The pan value is saved for the #Sound, so it's not needed to call it every time. The panning is a way to play a sound on a stereo equipment.

Parameters

#Sound The sound to use.
Pan The new pan value. Valid values are from -100 (full left) to 100 (full right). If the pan value is zero, then the sound is played on right and left speaker, equally.
Channel (optional) The channel to use. It's the value returned by PlaySound() when using the #PB_Sound_MultiChannel flag.

Return value

None.

Example

 InitSound()           ; Initialize Sound system
 UseOGGSoundDecoder()  ; Use ogg files

 ; Loads a sound from a file
 LoadSound(0, #PB_Compiler_Home +"Examples\3D\Data\Siren.ogg")
 ; The sound is playing
 PlaySound(0, #PB_Sound_Loop, 20)

 MessageRequester("Info", "The sound is playing in stereo.")
 
 SoundPan(0, -100)
 MessageRequester("Info", "The sound is playing only on the left channel.")
 
 SoundPan(0, 100)
 MessageRequester("Info", "The sound is playing only on the right channel.")
 
 SoundPan(0, 0)
 MessageRequester("Info", "The sound is playing in stereo.")
 
 FreeSound(0) ; The sound is freed
 End

Supported OS

Windows, MacOS X

<- SoundLength() - Sound Index - SoundStatus() ->