Jump to content

Play custom sound

Recommended Posts


first of all, this is not directly LSPDFR related, but since this is the most active DEV forum that I know, I am posting it here. Also I will use all the help in my future projects. (I am an audio designer.)


It's quite simple, I have the basics of programming, but it's like jumping to the unknown depths, with a parachute. 

I would like to know, if there is a way to play custom audio (from a folder inside GTA) using LUA (so I can work in realtime inside GTA).


I want to make a realistic audio simulation framework, which will simulate acustics, sound echo and so on. Mainly for weapons. I know, i know, we have many realistic sound mods, but it is not dynamic..


Can anyone help me with this? Much appreciated!

- this is my signature, ok? -

Share this post

Link to post
Share on other sites

Hello Martin,


Lua does not have any native function to play audio, so the easiest way would be to use a library for that. You can find some examples here: https://stackoverflow.com/questions/5365583/how-to-play-sound-in-lua


Note that this will play the audio from the GTA V process like any other "frontend" game audio, i.e. you cannot play it from a given game position to adjust for volume etc. These things you would have to implement yourself based on what parameters the library supports and what you can calculate from the game. Playing audio from your disk through the actual game world (i.e. a position in the game world) is possible, but much more complicated.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...