Speech Module โ
The Speech module provides a simple way to deal with speech/audio from coords or peds.
Getting Started โ
lua
local Speech = exports.bln_lib:speech()Basic Usage โ
Play speech from Entity โ
lua
local sound_ref_string = "0825_S_M_M_LIVERYWORKER_01_WHITE_01"
local sound_name_string = "FAREWELL_ON_HORSE"
speech.PlayFromEntity(PlayerPedId(), sound_ref_string, sound_name_string)Play speech from Coords โ
lua
local sound_ref_string = "0825_S_M_M_LIVERYWORKER_01_WHITE_01"
local sound_name_string = "FAREWELL_ON_HORSE"
local position = GetEntityCoords(PlayerPedId())
speech.PlayFromEntity(position, sound_ref_string, sound_name_string)Arguments: โ
| argument | description |
|---|---|
| Entity Or Position | ped id or position (x,y,z) |
| SOUND_REF_STRING | audio bank dictionary |
| SOUND_NAME_STRING | name of sound from audio bank dictionary. Name should not contain last doubles. For example, audio bank dictionary "0132_G_M_M_UNICRIMINALS_01_BLACK_01" contains seven names from GIDDY_UP_ESCALATED_01 till GIDDY_UP_ESCALATED_07. But sound_name_string for all of them is "GIDDY_UP_ESCALATED". |
| SPEECH_PARAMS_STRING | speech params string from table. Some params dont work. Use "speech_params_force" if u dont care |
| SPEECH_LINE | whats line to play (for GIDDY_UP_ESCALATED it is from 1 till 7). 0 - play random line. |
Speech Params: โ
lua
local speech_params = {
[0xB53AC261] = "speech_params_allow_repeat",
[0xF85DD899] = "speech_params_force",
[0xC3159875] = "speech_params_shouted",
[0x9DE2F602] = "speech_params_force_shouted_clear",
[0x9C0097D0] = "Speech_Params_Beat_Shouted_Clear_AllowPlayAfterDeath", -- uses subtitles, if it exists.
[0x3CA9FB81] = "speech_params_standard",
[0xFBDA0604] = "speech_params_force_shouted_critical",
[0x8CCE3B6B] = "speech_params_force_frontend",
[0x6043A6BF] = "speech_params_force_normal_critical",
[0xAA9D3FB8] = "speech_params_shouted_critical",
[0xA94E906A] = "speech_params_add_blip",
[0x5BDE1482] = "speech_params_force_normal",
[0x3A1B278D] = "speech_params_add_blip_shouted_force",
[0xA7E68047] = "speech_params_force_normal_clear",
[0x35891BFA] = "speech_params_add_blip_shouted",
[0x767F996E] = "speech_params_shouted_clear",
[0xE60F9DAC] = "speech_params_force_shouted",
}