# setSoundPan (Client)

> Moves a sound with no position towards the left or the right.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Sound
- **URL**: https://wiki.mymp.gg/en/setSoundPan

## Syntax

```lua
bool setSoundPan(sound sound, float pan)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `sound` | `sound` | The `sound` element, or a `dui` element for the browser's sound. |
| `pan` | `float` | From -1 (left only) to 1 (right only). 0 is the centre. |

## Returns

`true` if it was applied, `false` if the sound is 3D or was not found.

## Example

```lua
local beep = playSound("sounds/beep.wav")
setSoundPan(beep, -1)
```

## See also

- [getSoundPan (Client)](https://wiki.mymp.gg/en/getSoundPan.md): Returns the pan of a sound with no position.
- [setSoundPanningEnabled (Client)](https://wiki.mymp.gg/en/setSoundPanningEnabled.md): Turns stereo panning on or off for a 3D sound. When on, the sound leans left or right depending on the camera. It starts on.
- [playSound (Client)](https://wiki.mymp.gg/en/playSound-client.md): Plays a sound with no position in the world, on this client only. Fires onClientSoundStarted with the reason play.
