AudioClient

playPedAmbientSpeechWithVoiceNative

PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE0x3523634255FC3318

The GTA V native PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE of the AUDIO namespace, as LS:MP client scripts call it: the global function playPedAmbientSpeechWithVoiceNative, in JavaScript and in Lua.

SignatureJavaScript
playPedAmbientSpeechWithVoiceNative(
  ped: Ped,
  speechName: string,
  voiceName: string,
  speechParam: string,
  p4: boolean
): void
SignatureLua
playPedAmbientSpeechWithVoiceNative(
  ped: Ped,
  speechName: string,
  voiceName: string,
  speechParam: string,
  p4: boolean
)

Usage

JavaScript
playPedAmbientSpeechWithVoiceNative(ped, speechName, voiceName, speechParam, p4);
Lua
playPedAmbientSpeechWithVoiceNative(ped, speechName, voiceName, speechParam, p4)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
speechNamestringstringstring
voiceNamestringstringstring
speechParamstringstringstring
p4BOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This is the same as playPedAmbientSpeechNative and playPedAmbientSpeechAndCloneNative but it will allow you to play a speech file from a specific voice file. It works on players and all peds, even animals.

EX (C#):

GTA.Native.Function.Call(Hash.PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE, Game.Player.Character, "GENERIC_INSULT_HIGH", "s_m_y_sheriff_01_white_full_01", "SPEECH_PARAMS_FORCE_SHOUTED", 0);

The first param is the ped you want to play it on, the second is the speech name, the third is the voice name, the fourth is the speech param, and the last param is usually always 0.

Full list of speeches and voices names by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/speeches.json

Reference

Namespace
Audio AUDIO
In the game
void PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE(Ped ped, const char* speechName, const char* voiceName, const char* speechParam, BOOL p4)
Hash
0x3523634255FC3318
Formerly
_PLAY_AMBIENT_SPEECH_WITH_VOICE

Open in the interactive natives reference