FiveM Docs / Native Reference
API Set:
  • all
  • server
  • client
Language:
  • raw
  • lua
  • c#
  • js
Namespace: AUDIOAPI set: clientGame: gta5editImprove

GET_SOUND_ID

0x430386FE9BF80B45
0x6AE0AD56
// GetSoundId
int GET_SOUND_ID();
Returns:

Returns a sound id which can be used to control the sound after its has started playing.

If a playback function has a soundId field but the sound doesn't need to be altered after triggering then pass a value of -1 for fire-and-forget playback, rather than getting a soundId.

SoundId's can be reused, without needing to release them and grab a new one.

If a sound's finished playing, you can reuse its SoundId to kick off another one.

If the sound's not finished playing, it'll be stopped first (fading out or whatever is set up in RAVE by the sound designer), and the new one kicked off; usually it is safer to just get a new SoundId.

SoundId's are not automatically cleaned up, you must use RELEASE_SOUND_ID after you've finished using them to allow the engine to recycle the sound id.

Privacy
•
Cookie Policy
•
Cookie Settings
ENABLE_VEHICLE_EXHAUST_POPS(Vehicle vehicle, BOOL toggle)
ENABLE_VEHICLE_FANBELT_DAMAGE(Vehicle vehicle, BOOL enableFanbeltDamage)
FIND_RADIO_STATION_INDEX(int stationNameHash)
FORCE_MUSIC_TRACK_LIST(char* radioStation, char* trackListName, int timeOffsetMilliseconds)
FORCE_PED_PANIC_WALLA()
FORCE_USE_AUDIO_GAME_OBJECT(Vehicle vehicle, char* gameObjectName)
_FORCE_VEHICLE_ENGINE_SYNTH(Vehicle vehicle, BOOL force)
FREEZE_MICROPHONE()
FREEZE_RADIO_STATION(char* radioStation)
GET_AMBIENT_VOICE_NAME_HASH(Ped ped)
GET_AUDIBLE_MUSIC_TRACK_TEXT_ID()
_GET_CURRENT_RADIO_TRACK_PLAYBACK_TIME(char* radioStationName)
GET_CURRENT_SCRIPTED_CONVERSATION_LINE()
GET_CURRENT_TRACK_SOUND_NAME(char* radioStationName)
GET_IS_PRELOADED_CONVERSATION_READY()
GET_MUSIC_PLAYTIME()
GET_MUSIC_VOL_SLIDER()
GET_NETWORK_ID_FROM_SOUND_ID(int soundId)
GET_NEXT_AUDIBLE_BEAT(float* timeInSeconds, float* bpm, int* beatNum)
GET_NUM_UNLOCKED_RADIO_STATIONS()
GET_PLAYER_RADIO_STATION_GENRE()
GET_PLAYER_RADIO_STATION_INDEX()
GET_PLAYER_RADIO_STATION_NAME()
GET_RADIO_STATION_NAME(int stationIndex)
GET_SOUND_ID()
GET_SOUND_ID_FROM_NETWORK_ID(int netId)
GET_STREAM_PLAY_TIME()
GET_VARIATION_CHOSEN_FOR_SCRIPTED_LINE(char* textLabel)
GET_VEHICLE_DEFAULT_HORN(Vehicle vehicle)
GET_VEHICLE_DEFAULT_HORN_IGNORE_MODS(Vehicle vehicle)
GET_VEHICLE_HORN_SOUND_INDEX(Vehicle vehicle)
HAS_LOADED_MP_DATA_SET()
HAS_LOADED_SP_DATA_SET()
HAS_SOUND_FINISHED(int soundId)
HINT_AMBIENT_AUDIO_BANK(char* bankName, BOOL bOverNetwork)