# AUDIO::PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE

- **Hash:** `0xED640017ED337E45`
- **Namespace:** AUDIO
- **Runtime name (Lua/JS):** `PlayAmbientSpeechFromPositionNative`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/AUDIO/PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE

## Signature

```c
BOOL PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE(float x, float y, float z, Any* params);
```

## Parameters

- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `params` (`Any*`)

## Returns

`BOOL`

## Description

*Source: alloc8or RDR3 NativeDB*

Play a speech from a position.
params struct for ScriptedSpeechParams see: PLAY_PED_AMBIENT_SPEECH_NATIVE

*Source: VORPCORE RDR3natives*

Old name: _PLAY_AMBIENT_SPEECH_AT_COORDS

## Usage

### Lua

```lua
local retval, params = PlayAmbientSpeechFromPositionNative(x, y, z, params)

-- always available, by hash
local retval, params = Citizen.InvokeNative(0xED640017ED337E45, x, y, z, Citizen.PointerValueIntInitialized(params), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, params] = PlayAmbientSpeechFromPositionNative(x, y, z, params);

// by hash
const [retval, params] = Citizen.invokeNative('0xED640017ED337E45', x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueIntInitialized(params), Citizen.returnResultAnyway());
```

### C#

```csharp
var params = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xED640017ED337E45, x, y, z, params);
// params.GetResult<int>()
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.
- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
