PendingSound - "A simple utility resource to allow you to play sounds to your clients."

What is PendingSound?

PendingSound is a FiveM utility resource that allows you to play sounds to your clients in a modular way, allowing you to remove resources without excess bulk of left over sound files.

Update 1.2 allows you to play sounds through external URLs.
Update 1.3 allows you to play sounds based on coordinates defined.


Where main resource is the resource that you are editing and helper resource is PendingSound. This diagram is outdated but I think it still conveys the point.

Inspirations / Credits

Interact Sounds - The issue that I had with Interact Sounds is that you had to import the sound files directly into the resource itself rather than being able to use a file that was already in the resource that you are calling from. It seemed time inefficient to me - although I am aware that some of their features are superior to mine.

User d-bubble - CFX Forums see Sharing Audio Between Resources - #6 by d-bubble

Play around with it!

Go download it and play around with adding sounds easily into your own server! Licenses and readmes are in the repository.

I will continue to monitor this thread for any questions. README and LICENSE is in the repository above, please read them.

4 Likes

This is really interesting… I had a plan for a tornado siren, do you think that could be possible utilizing this?
Plan on looking at the github when i get some free time

A tornado siren could definitely be something that’s implementable.

The server sided function can be used to call to each client in an area.

I have, however, forgotten to implement a stop function for the audio files (oops :shushing_face:) I’ll update that tomorrow lmao.

1 Like

Version 1.1 now has StopSound exports.

i will start working on it sometime this week and hopefully post a release soon,

great work by the way!

So how is this working ? Sorry i’m a noob, how do you use it ? The same way as we did with interact sound ? Looks like from what i’m seeing in the export

this is amazing work!

Preview Video

i was able to get my siren working!

would there be a way in the future to stream a mp3 url instead of a local sound?

InteractSound and my resource is very similar.

The difference between the two is that InteractSound - as far as I am aware requires any sounds that you play locally to be put in the InteractSound resource.

My resource on the other hand allows you to put the files in the resource that you are calling it from. When I remove the resource that calls for the sound to play from my server I won’t have to go around removing the files in InteractSound and all of my project files are in the resource itself.

Edit : the specifics of how to call sounds to play are in the README.md

1 Like

Version 1.2 - Playing sounds through URL

Thanks again! Awesome work :slight_smile:

Can you please also install an export for the volume adjustment because your script is great and I want to use it properly, but I’m missing the one function to set the volume

I think you were meaning to be over on this thread PendingSound - "A simple utility resource to allow you to play sounds to your clients." - #10 by OKCRP

See the README.md - you control the volume of each sound separately.

Yes, you can set it once, that’s true, the export should be used so that you can change the volume dynamically the closer you get to it

nice work bro

Ah. Now I understand. That’s something that I’ll work on playing a sound in a specific location.

So, i’ve tried this one to see how it works. Can’t figure it out why it’s not working for me. I followed the examples from readme. Still no sound and on top of that i get other errors in my resource after adding the export. I’m doing something wrong for sure but i’ll stick with interact-sound for now.

If this will be updated in feature to have dynamic volume and play sounds from coords etc maybe I’ll replace the interact-sound. Adding the sound files in diff resources seems to be just a prefered option for many.

Using the export :

fxmanifest inside my script:

And the Error in game:

I would appreciate some help on this.

You’ll need to change your argument from "belle.ogg" to "sound/belle.ogg".

Essentially, you need to have whatever you put in the files argument of your __resource.lua

Did that, still the same error.

Could you send your resource’s file structure please.

I looked at your code: issue should be fixed - see your direct messages.

For anyone else that may be struggling with the resource - it was due to a mismatch of naming between “sounds/belle.ogg” and the actual file name “sounds/belle.ogg.ogg”