# setCinematicAudio (Client)

> Sets the sounds the cinematic plays during playback. It replaces the earlier sounds.

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

## Syntax

```lua
bool setCinematicAudio(cinematic cinematic, table cues)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `cinematic` | `cinematic` | The cinematic. |
| `cues` | `table` | A list of sounds, in order of `time`. |

## Returns

`true` if they were applied. `false` if the table is invalid, with a warning saying why.

Each sound plays as a `sound` element under the cinematic and has:

- `time`: when it starts, in cinematic ms (required).
- `sound`: the path of a sound file in a resource (required).
- `from`: ms into the sound to start at. `length`: how much to play; `0` goes to the sound's end.
- `fadeIn` and `fadeOut`: fade ms.
- `volume`: from 0 up, 1 by default.
- `duck`: the fraction of its volume, from 0 to 1, while an actor speaks. 1 by default.
- `speed`: from 0.1 to 10, 1 by default.
- `actor`: the actor that speaks the sound; its mouth moves with it.
- `spatial`: with `actor`, `true` (default) plays it from the actor's head, `false` plays it unplaced.
- `track`: a number from 0 to 255 kept with the sound.

## Example

```lua
local intro = createCinematic("cinematics/intro.cine")
setCinematicAudio(intro, {
    { time = 0, sound = "audio/theme.ogg", volume = 0.6, duck = 0.4, fadeOut = 2000 },
    { time = 3000, sound = "audio/hero_line1.ogg", actor = "hero" },
})
```

## See also

- [getCinematicAudio (Client)](https://wiki.mymp.gg/en/getCinematicAudio.md): Returns the cinematic's sounds.
- [setSoundSpeaker (Client)](https://wiki.mymp.gg/en/setSoundSpeaker.md): Has a ped speak a sound: its mouth moves with the sound's level and, if the sound is 3D, it comes from the ped's head every frame.
- [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.
