you can play multiple audio at same location, but it will not sound good. Also i found out it sometimes doesnt want to play youtube/direct url for 1 guy from 10 for some reason, i am trying to fix that but i cant get it working…
i think you can just do xSound.PlayUrl(“test”, “…/sounds/something.ogg”, 1.0)
it should work. i just dont like the idea a player would have to download all sound etc… it takes long and fivem server already got around 200 resources + and it takes forever to download it all…
if the double dot will work same way like in css it should find a root directory in that surten res… but no idea.
Thank you for the SoundSystem works well.
Unfortunately only clientside.
What am I doing wrong?
i have no idea what you’re doing wrong… You should consider showing me code so i can tell… 
Hello, i made an emulator for awesome sound api interact-sound.
What it does ? it just listen to events from interact-sound and play them in my xSound API.
What you just need to do is move sounds from interact-sound to xsound/html/sounds and thats it…
nothing else you have to do.
Hey, I adapted your module to a boombox module and I got it working as expected, the only issue I have is that when another player comes within audible distance, they cannot hear the music I set the boombox with, is there any way to achieve this?
just send me your code to pm, i will take a look.
I’ve been looking into using this for a seamless radio system, however I’ve run into the issue where the videos cannot be started part-way through, they have to start at the beginning.
Since HTML has been used for the audio of the library, is it possible to adjust the code to allow for a time-stamp based start of the audio since it can use youtube videos? Commonly ending in ?t=(time in seconds).
Great release by the way!
at the moment, my API cannot play audio from x second, it is possible but you have to edit the youtube API and widget API
I found a function to do it…
for the youtube API: player.seekTo(time) // unsure might be float or just numbers or milliseconds.
widget API: player.seekTo(time) // time in miliseconds
I did find that if you add
playerVars: {
‘start’: “#”,
},
to the yPlayer inside SoundPlayer.js (around line 136) this will get the player to start at a defined time. Just need to backtrack where the data comes from to be linked to the command or whatever might be used to start the audio then you have your timestamp-based starting.
Thanks for the help!
This Play Audio only client side, plz Help
xSound = exports.xsound
Citizen.CreateThread(function()
local pos = GetEntityCoords(PlayerPedId())
xSound:PlayUrlPos("name","http://soundbible.com/mp3/Eject%20Clip%20And%20Re-Load-SoundBible.com-423238371.mp3",1,pos)
xSound:Distance("name",100)
exports['mythic_notify']:DoHudText('inform', 'Testtasten Sound by' .. Config.Kraft )
print('Testtasten info console')
-- ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', kraft)
Citizen.Wait(1000*30)
xSound:Destroy("name")
end)
I’m planing to play same music on 5 players at same time How it gonna be? I can code it myself but what about ms? High or not?
@Xogos1 Using this, where exactly is the sound being outputted from? The player orrr??
TriggerServerEvent(‘InteractSound_SV:PlayWithinDistance’, 0.5, ‘SomeSound’, 0.5)
yes, the player. also 0.5 for max distance is really small. i recomend 8-10.
RegisterServerEvent('InteractSound_SV:PlayWithinDistance')
AddEventHandler('InteractSound_SV:PlayWithinDistance', function(maxDistance, soundFile, soundVolume)
TriggerClientEvent('InteractSound_CL:PlayWithinDistance', -1, source, maxDistance, soundFile, soundVolume)
end)
or you can try use exports. it is easier
xSound = exports.xsound
Citizen.CreateThread(function()
xSound:PlayUrlPos("name","http://relisoft.cz/assets/brainleft.mp3",1, vector3(0,0,0))
xSound:Distance("name",10)
end)
Is it possible to play sounds more than 15 secs?
I would love to use exports so I can play sounds from an entity, but the sound I’m trying to use is an .ogg file. I dont know how to link .ogg file from xsound/html/sounds
if its an ogg file just use
xSound:PlayUrlPos(“name”,"./sounds/name.ogg",1.0, vector3(0,0,0))
new xSound update !
Bug fixed:
- When sound played on the position you could hear the sound for 0.1 seconds before faint away. fixed
these events added
- onPlayStart
- onPlayEnd
- onLoading
- onPlayPause
- onPlayResume
new functions added:
-
onPlayStart(name, function)
-
onPlayEnd(name, function)
-
onLoading(name, function)
-
onPlayPause(name, function)
-
onPlayResume(name, function)
-
getTimeStamp(name)
-
getMaxDuration(name)
-
setTimeStamp(name, time)
-
setTimeStamp(source ,name, time)
new column in array added
timeStamp
maxDuration
Hi Xogos! Thank you for the api! It’s working great.
The only problem i’m having is that playing url at some position always plays at 100% no matter if i set the volume to 1 or 0.1
Give me the code so i can see where is the problem.
Cant fix it without the code.
Oops my bad, this is the code.
Btw y changed my user i’m Leandro.
Ty for your time
xSound = exports.xsound
Citizen.CreateThread(function()
local pos = GetEntityCoords(PlayerPedId())
xSound:PlayUrlPos("name","https://www.youtube.com/watch?v=tzBGEqkwCoY",1,pos)
--some links will not work cause to copyright or autor did not allowed to play video from iframe.
xSound:Distance("name",50)
print(xSound:getVolume("name"))
Citizen.Wait(1000*30)
xSound:Destroy("name")
end)
EDIT: I found what happened. Once you start an audio with some name, even if you destroy it, it will keep the volume that was set the first time.
Using setVolumeMax after initializing it again works fine. Ty for your time