# setSoundVolume (Shared)

> Changes a sound's volume. On a 3D sound, it still falls with distance. On the server, the change is sent to every client.

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

## Syntax

```lua
bool setSoundVolume(sound sound, float volume)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `sound` | `sound` | The `sound` element. On the client a `dui` element also works, for the browser's sound. |
| `volume` | `float` | The volume, where 1 is normal and 0 is silent. |

## Returns

`true` if the sound was found, `false` otherwise.

## Example

```lua
local music = playSound("sounds/track.mp3", true)
setSoundVolume(music, 0.3)
```

## See also

- [getSoundVolume (Shared)](https://wiki.mymp.gg/en/getSoundVolume.md): Returns a sound's volume, not counting how it falls with distance.
- [setSoundMaxDistance (Shared)](https://wiki.mymp.gg/en/setSoundMaxDistance.md): Sets the distance at which a 3D sound goes silent. The default is 20 m. On the server, the change is sent to every client.
- [setSoundPan (Client)](https://wiki.mymp.gg/en/setSoundPan.md): Moves a sound with no position towards the left or the right.
