# setSoundSpeaker (Client)

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

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

## Syntax

```lua
bool setSoundSpeaker(sound sound, ped|false speaker)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `sound` | `sound` | The `sound` element, or a `dui` element for the browser's sound. |
| `speaker` | `ped\|false` | The ped or player who speaks the sound, or `false` for none. |

## Returns

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

## Example

```lua
local ped = createPed("male01", 2495.1, -1687.4, 13.5)
local line = playSound3D("voice/greeting.ogg", 2495.1, -1687.4, 13.5)
setSoundSpeaker(line, ped)
```

### Coming from MTA

Not in MTA. It works like GTA V's `PLAY_STREAM_FROM_PED`.

## See also

- [getSoundSpeaker (Client)](https://wiki.mymp.gg/en/getSoundSpeaker.md): Returns the ped who speaks a sound.
- [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.
