# setSoundPanningEnabled (Client)

> 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.

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

## Syntax

```lua
bool setSoundPanningEnabled(sound sound, bool enabled)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `sound` | `sound` | The `sound` element, or a `dui` element for the browser's sound. |
| `enabled` | `bool` | `true` for the sound to come from the side it is on. |

## Returns

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

## Example

```lua
local ambience = playSound3D("sounds/wind.ogg", 0, 0, 10, true)
setSoundPanningEnabled(ambience, false)
```

## See also

- [isSoundPanningEnabled (Client)](https://wiki.mymp.gg/en/isSoundPanningEnabled.md): Tells whether a 3D sound has stereo panning on.
- [setSoundPan (Client)](https://wiki.mymp.gg/en/setSoundPan.md): Moves a sound with no position towards the left or the right.
- [playSound3D (Client)](https://wiki.mymp.gg/en/playSound3D-client.md): Plays a sound at a position in the world, on this client only. Its volume falls with distance between setSoundMinDistance (5 m) and setSoundMaxDistance (20 m). Fires onClientSoundStarted with play.
