# onClientSoundStarted (Client)

> Fired when a sound starts playing on this client or leaves a pause.

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

## Syntax

```lua
addEventHandler("onClientSoundStarted", root, function(string reason) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `reason` | `string` | `play` when the sound starts, `resumed` when it leaves a pause. |

## Source

The `sound` element.

`play` comes from this client's `playSound` and `playSound3D` and from a server sound when it starts here. `playSFX` and `playSFX3D` do not fire the event.

## Example

```lua
addEventHandler("onClientSoundStarted", root, function(reason)
    if reason == "play" then
        outputDebugString("sound started: " .. tostring(getSoundLength(source)) .. " s")
    end
end)
```

## See also

- [onClientSoundStopped (Client)](https://wiki.mymp.gg/en/onClientSoundStopped.md): Fired when a sound stops playing on this client: paused, stopped or finished.
- [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.
- [setSoundPaused (Shared)](https://wiki.mymp.gg/en/setSoundPaused.md): Pauses or resumes a sound. On the server, the change is sent to every client.
