GithubHelp home page GithubHelp logo

xsound's Introduction

๐Ÿ˜ Checkout our store for more amazing resources https://store.rcore.cz/
๐ŸŽต Resources using this API https://store.rcore.cz/category/music

Improved audio library for FiveM

Can work with API interact sound
Just make sure you take all sounds from interact
sound and move them to xsound/html/sounds

Thanks to
https://github.com/plunkettscott
for awesome api
https://github.com/plunkettscott/interact-sound

SoundSystem functions

1. Functions (client side)


Playing sound


  • PlayUrl(name, URL, volume, loop, options)
    Will play sound from URL (can be heard everywhere)
    argument loop and options are optional, doesn't have to be used.

  • PlayUrlPos(name, url, volume, Vector3 vec, loop, options)
    Will play sound from url at x,y,z location
    argument loop and options are optional, doesn't have to be used.

options list

  • onPlayStart
  • onPlayEnd
  • onLoading
  • onPlayPause
  • onPlayResume

Manipulation with sound


  • Position(name, Vector3 vec)
    Will update location of sound

  • Distance(name, newDistance)
    Will set new playing distance from location

  • Destroy(name)
    Will destroy sound

  • Pause(name)
    Will pause sound

  • Resume(name)
    Will resume sound

  • setVolume(name,volume) volume is from 0.0 to 1.0
    Will set a new value to volume. Should be used for non 3D sound

  • setVolumeMax(name,volume) volume is from 0.0 to 1.0
    will set new value to max volume. Should be used only for 3D sound

  • setTimeStamp(name, time) will set a new timestamp.

  • setSoundURL(name, url) will set new URL to sound (will play whenever changed)

  • repeatSound(name) will play again the saved sound

  • destroyOnFinish(name, bool) true = destroy on end / false = do not destroy on end

  • setSoundLoop(name, bool) will set a new value to loop

  • setSoundDynamic(name, bool) will set if the sound is 3D / 3D = true


Effects on sound


  • fadeOut(name, time)
  • fadeIn(name, time, volume)

Events (client side only)


  • onPlayStart(name, function)
    This event will trigger after the sound
    is loaded and start playing in game.

  • onPlayEnd(name, function)
    This event will be triggered after sound end.

  • onLoading(name, function)
    This event will be triggered when the sound start loading.

  • onPlayPause(name, function)
    This event will be triggered whenever you pause sound.

  • onPlayResume(name, function)
    This event will be triggered whenever you resume sound.


Getting info about sound


  • soundExists(name)
    Will return true/false if sound exists

  • isPaused(name)
    Will return true/false if song is paused

  • isPlaying(name)
    Will return true/false if song is playing

  • isLooped(name)
    Will return true/false if sound is looped

  • getDistance(name)
    Will return distance in Integer

  • getVolume(name)
    Will return current volume of music.

  • getPosition(name)
    Will return vector3

  • isDynamic(name)
    Will return if sound is 3D or 2D (3D = true, 2D = false)

  • getTimeStamp(name)
    returns current timestamp

  • getMaxDuration(name)
    returns max duration of sound

  • getLink(name)
    Will return url link

  • isPlayerInStreamerMode()
    will return if player got streamer mode enabled.

  • getAllAudioInfo()
    Will return array of all sound

  • isPlayerCloseToAnySound()
    will return true if player is close to any sound.

  • getInfo(name)
    Will return an array with info of the sound...

{
   volume,          -- value from 0.0 to 1.0
   url ,            -- sound url
   id,              -- id 
   position,        -- will be nil if position isnt set.
   distance,        -- distance in integer
   playing,         -- true/false
   paused,          -- true/false
   loop,            -- true/false
   isDynamic,       -- true/false
   timeStamp,       -- returns current timestamp
   maxDuration,     -- returns max duration of sound
   destroyOnFinish, -- default value is true means after its finish it will destroy it self
}

1. Functions (Server side)


Playing sound


  • PlayUrl(source, name, URL, volume, loop)
    Will play sound from URL (can be heard everywhere)

  • PlayUrlPos(source, name, url, volume, Vector3 vec, loop)
    Will play sound from url at x,y,z location


Manipulation with sound


  • -1 for source work as well

  • Position(source, name, Vector3 vec)
    Will update location of sound

  • Distance(source, name, newDistance)
    Will set new playing distance from location

  • Destroy(source, name)
    Will destroy sound

  • Pause(source, name)
    Will pause sound

  • Resume(source, name)
    Will resume sound

  • setVolume(source, name,volume) volume is from 0.0 to 1.0
    Will set a new value to volume. Should be used for non 3D sound

  • setVolumeMax(source, name,volume) volume is from 0.0 to 1.0
    will set new value to max volume. Should be used only for 3D sound

  • setTimeStamp(source ,name, time) will set a new timestamp.
    TIMESTAMP is in a seconds only !


Showcase how it can stream sound at game

https://www.youtube.com/watch?v=zyZmF5bRSA4

https://www.youtube.com/watch?v=19Q2GVYElSE

Showcase what I did with my API

#These are just a showcase! I will not share them....

https://www.youtube.com/watch?v=OOf6PZFpfkI

https://www.youtube.com/watch?v=JRTVga_FwGw

xsound's People

Contributors

duboiss avatar elarthuro90 avatar marcell1988 avatar operas1 avatar xenknight61 avatar xogy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xsound's Issues

Play client sound & play entity sounds

Is your feature request related to a problem? Please describe.
Yes, I get very frustrated when I try to play sound on a player. For example, we use xsound for our phone, and we use it for ringtones as well as a music app. We current are using the PlayURLPos() function, which works great when standing still. As soon as you start running or driving, the sound lags behind because the refresh rate is too slow. Even when I make it really short refresh, it still lags behind when going over 100mph. I am requesting two features here.

PlayOnEntity - it emits the sound from the entity (player) and moves as the character moves, no need to update position.

The MOST important feature I would like is PlayURLClient() - the ability to play a sound for ONLY a specific client, not anyone else. Basically the PlayURL() but only send it to one player, not everyone.

Describe alternatives you've considered
I tried playing around with the refresh rate and none of it worked as intended, as well as changing the ranges and that didnt work either.

Sounds are playing late

i wanted to use xsound for pop up exhaust sounds for my script, but sounds are running late and can't be stacked up

PlayUrlPos refuses to work

Issue

When i run the code below, the print functions all work fine, but no audio is playing whatsoever, I've been running in circles trying to figure out what I've done wrong, if anything.

RegisterNetEvent('SEM_InteractionMenu:PlaySound')
AddEventHandler('SEM_InteractionMenu:PlaySound', function(action)

    if action == 'Cuff' then
    xSound = exports.xsound

        local pos = GetEntityCoords(playerPed)

        print('Attempting to play cuff sound')

        xSound:PlayUrlPos("cuff", 'https://www.youtube.com/watch?v=6EhtM5M2Iu8', 1, pos)
        xSound:Distance("cuff", 100)

        print('Played cuff sound')

        Citizen.Wait(2000)
        xSound:Destroy("cuff")

        print('Destroyed cuff sound')

    elseif action == 'Uncuffed' then

    xSound = exports.xsound

        local pos = GetEntityCoords(playerPed)

        print('Attempting to play uncuff sound')

        xSound:PlayUrlPos("uncuff", 'https://www.youtube.com/watch?v=t9ujXXs90j8', 1, pos)
        xSound:Distance("uncuff", 100)

        print('Played uncuff sound')

        Citizen.Wait(2000)
        xSound:Destroy("uncuff")

        print('Destoryed uncuff sound')

    else
        print("Unexpected action: " .. action)
    end
end)

Console
The console prints out this:

[script:SEM_Interacti] Attempting to play cuff sound
[script:SEM_Interacti] Played cuff sound
[script:SEM_Interacti] Destroyed cuff sound
[script:SEM_Interacti] Attempting to play uncuff sound
[script:SEM_Interacti] Played uncuff sound
[script:SEM_Interacti] Destoryed uncuff sound

Feature Request

is it possible for a nightclub extension to use more then one location with just one song YT or MP3

LG Minkh

xsound server lua PlayUrlPos(source, name, url, volume, position, loop) calls not working

Describe the bug
I tried to call xsound from my server lua. the method I tried is PlayUrl and PlayUrlPos.
It doesn't even play the sound or in other words, not working at all.
It produces an error on the client console.

To Reproduce
Steps to reproduce the behavior:

  1. Call PlayUrl or PlayUrlPos on server.lua
  2. add print('something') into xsound's server resource it self
  3. then look on in game console (press F8), then look at the screenshots i attached below
  4. See error

Expected behavior
I expected the xsound working on the server side.
Because i want to run xsound instance position updates only happen in server side.
I want to attach sound into npc ped, so everytime the ped moved, it also update the xsound instance position.

Screenshots
image

Suggested Solution

  • Change the way of sending data to the RegisterNetEvent listener on the client.

xsound not working

Describe the bug
when i add xsound to my resources it cancels out any other sound even when transferring all interact sounds to xsound 'sound' folder

im using qbcore latest version

To Reproduce
Steps to reproduce the behavior:
place xsound in resources
ensure it
copy ogg files from interact sound to xsound

Expected behavior
all sounds fail to work

After TriggerServerEvent to execute xSound:PlayUrlPos() , trying to client side xSound:IsPlaying(id) gives error

Describe the bug

I'm trying to create a playlist using xsound, i have a list of songs and this function for testing it in client-side:

`
function playPlaylist(coords, id)
local musics = {
'https://www.youtube.com/watch?v=9ug1xj2-yBo',
'https://www.youtube.com/watch?v=iOM20kM2gOQ'
}
if #musics > 0 then
TriggerServerEvent("chucky_bailefunk:play_music", id, musics[1], 1, coords)

    if xSound:isPlaying(id) then
        print('is playing music')
    end
end

end
`

the songs plays after server-side is triggered. what i want to do is to check if there is a sound being played.

if xSound:isPlaying(id) then

after that i want to check sound getMaxDuration, so i will set a Wait(xSound:getMaxDuration(id)) in the for-loop that goes through "musics".

but i'm getting :

An error occurred while calling export isPlaying in resource xsound:


Expected behavior
if xSound:isPlaying(id) then local max_duration = xSound:getMaxDuration(id) Wait(max_duration) Loop throug "musics" end

Cannot play the same sound url when called again.

Describe the bug

  • Cannot play the same url again.

To Reproduce

  • Steps to reproduce the behavior:
RegisterCommand('soundtest', function()
    exports['xsound']:PlayUrl('tsunami', './sounds/tsunami.ogg', 0.8)
end, false)
  • The sound plays when you execute the command the first time, but when executed again after the sound has finished, it throws this error:

Screenshot_119

the same error gets thrown even when I specified false to the loop parameter

exports['xsound']:PlayUrl('tsunami', './sounds/tsunami.ogg', 0.8, false)

Expected behavior

  • The sound should be able to play again since by default it gets destroyed on finish.

Screenshots

  • See above

Additional context

  • tsunami.ogg is 30 seconds long

Warning: could not find file `html/sounds/*.ogg` (defined in fxmanifest.lua:35)

Warning: could not find file html/sounds/*.ogg (defined in fxmanifest.lua:35)
A clear and concise description of what the bug is.

Hi,
Despite the fact that we are using the most recent version of QB-Core, we have observed an error in our console that reads: ( Warning: could not find file html/sounds/*.ogg (defined in fxmanifest.lua:35)

To Reproduce
reproduce this mistake the issue is displayed in the FX console after downloading the most recent version of QB-core.

Expected behavior
No error prints or messages

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2023-06-01 190016

Asking for Interact-sound compatibility clarifications & making an offer

I'm sorry to make questions that I myself could find the answer to, but I think you already have the answers, I'm overloaded with work and at the same time I'm making an offer

  • Should interact-sound NOT be used alongside Xsound?

  • By Can work with API interact sound in README.MD, did you mean it's fully compatible BUT one has to change the triggered events or make a compatibility layer, right?

  • if made a Plug & Play compatibility layer (with interact-sound's event names) and made a pull request, would you accept it?

Play sound from Entity

Right now, what's missing from this glorious audio library is the ability to link sound to an entity.

This would work by updating the sound's coords based on entity position of local client, (would include checks to see if the entity is valid or not, and handle the sound afterwards), including volume distance, etc.

This can obviously be done in a script apart from xSound, however I believe an API implementation will be better suited to such a framework for developers.

Export onPlayEnd is not working

Describe the bug
The export onPlayEnd is not working im getting this error below:

802_GTAProce]             MainThrd/ ^1SCRIPT ERROR: @xsound/client/exports/events.lua:8: attempt to index a nil value (field '?')^7
[   9195937] [b2802_GTAProce]             MainThrd/ ^3> ref^7 (^5@xsound/client/exports/events.lua^7:8)
[   9195937] [b2802_GTAProce]             MainThrd/ ^3> fn^7 (^5@lb-musicapp/client.lua^7:112)
[   9195937] [b2802_GTAProce]             MainThrd/ ^1SCRIPT ERROR: @lb-musicapp/client.lua:112: 
[   9195937] [b2802_GTAProce]             MainThrd/ ^5 An error occurred while calling export `onPlayEnd` in resource `xsound`:

image

My Code:

xSound:onPlayEnd(musicId, function()
    print("end")
end)

image

Hear Music bug

Describe the bug
1 From 100 Players can not hear Music.

To Reproduce
Steps to reproduce the behavior:

  1. Use xSound 1.4.1

For some reason, distance isn't working

Here is the code I am using: Client side.

RegisterNetEvent("resource-name:eventname")
AddEventHandler("resource-name:eventname", function(audioUrl, volume, distance, rand)
local playerped = PlayerPedId()
local pedcoords = GetEntityCoords(playerped)
local rand = rand
exports['xsound']:PlayUrlPos('resp'..rand, audioUrl, volume, pedcoords)
exports['xsound']:Distance('resp'..rand, distance)
exports['xsound']:setSoundDynamic('resp'..rand, true)
print(json.encode(exports['xsound']:getInfo('resp'..rand)))
--exports['xsound']:Destroy('resp'..rand, true)
end)

Current status: Basically, the audio is working. We're able to hear it. I am using Google tts API for this and it works perfectly fine.
Problem is, I am not sure if I'm implementing distance properly.
image
But it shows here (image) that the distance is set and coords is also set. Did some print tests too and these are set properly.

Problem is, it is still being heard by everyone.
Kindly advise, thank you.

Uncontrollable after changing radio station links

Sometimes after changing radio stations (like ones from here: https://github.com/ozok/OooPlayer/blob/master/Release/Win32/Radios/All.txt ), the music stops being controllable when it was before. This leads to the music getting stuck on/volume. For example, I was playing a top 40 channel (volume/play/stop works), changed to a country channel (volume/play/stop works), and then back to the same top 40 channel where the volume/play/stop doesn't work. The only way I can get the music to stop is by restarting xsound. When they become uncontrollable it can lead to the music being heard on players not nearby which they cannot stop hearing the music until the restart of xsound.
Along with being unable to change the radio from the current link can happen, making it get stuck off until you mess with the volume/play/pause buttons.
(Using MusicEverywhere)

missing html

resources:xsound] Warning: could not find file `html/sounds/*.mp3` (defined in fxmanifest.lua:35)

not in the newest build nor in the master build

Error when using with Red M

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. As soon as the interlocutor picks up the phone, these errors come

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot_8
Fh6xxbaDRymxFzq8JTEqDA

https://streamable.com/3pc56o

Additional context
The script creator says it's up to xsound, which is why I wanted to ask you if you have any idea what the problem is.

Warm greetings

Text to speech does not work

Describe the bug
I would like to use the TTS functionality but it does not work. There is no sound coming out.

To Reproduce
Steps to reproduce the behavior:

  1. Start the resource: start xsound
  2. Call the TTS function :
function playTextToSpeech()
    print("DEBUG Trains : Play TTS")
    text = "toto"
    exports.xsound:TextToSpeechPos("testTTS", "en-FR", text, Config.VolumeSon, Config.Location)    -- where Config.VolumeSound = 0.5 and Config.Location a location in vector3
end
  1. Launch the function : playTextToSpeech()
  2. No error in the console but no spells

Expected behavior
A voice that orally says my typed text.

Screenshots
Nothing to show for it

Additional context
I tested the parameters like coordinates and location with the PlayUrlPos function and it works very well by putting a URL.

Also, copying the generated URL from the TTS and pasting it on a browser, it does sound good coming out as a google voice.
But impossible to hear the result in the game.

PlayUrlPos not working

Describe the bug
I am trying to play a local sound (stored in the sounds folder of xsound) by position and it does not play, however if instead of playing it by position I make it play only for a player it is heard, I have already tried to launch the playback from both client and server, and even with a youtube sound instead of a local one, with the same result in all cases.

This is the code i use in server side:

exports['xsound']:PlayUrlPos(-1, "dice", "./sounds/dice.mp3", 1, GetEntityCoords(GetPlayerPed(playerId)))
exports['xsound']:Distance(-1, "dice", 2.0)

Error at Initialization

Describe the bug
when i initialize the script it throws an error in the Javascript

To Reproduce
Steps to reproduce the behavior:

  1. Go to '/xsound/html/scripts'
  2. Click on 'SoundPlayer.js'
  3. Scroll down to 'Line - 320'
  4. See error

Uncaught TypeError: this.yPlayer.seekTo is not a function (@xsound/html/scripts/SoundPlayer.js:320)

Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'. (:0)

Server wide trigger, Cheater issue

The cheaters are able to jst load in the server and play server wide
Music without any issues
WHich they end up playing racist and bad stuff

Set Looping Option

The library is working very well,

A nice feature would be to have an option SetLooping(true/false) so instead of using Destroy and the sounds stops right away, SetLooping will finish playing the audio file and then stop, then you can check with IsLooping() if the sound has finished and Destroy it.

Great job and thanks for the amazing work.

[request] Multiple positions - [bug] yPlayer.seekTo

[feature request]

I wanted to make multiple "speaker" positions in one club for a better feeling.
The only problem now is, that when i create 4 different positions and play the same music on all, every position is delayed a bit more.

It would be nice if its possible to create multiple positions in one "name" for the music to be played.
In that way instead of just one position, you could directly update the whole "name"-group with a new song for example.
Maybe take a table with vec3's instead of one simple vec3 in the PlayUrlPos export.
The music could be played either on all positions simultaneously or one time in the middle of all with volume recalculated based on the distance to the near positions.

[bug]

If you try to set the timestamp to.. 10 seconds it will print that yPlayer.seekTo is not a function.
Screenshot_3

and 3D-Sound doesnt seem to work either, i always hear the music on both sides.

It could be me beeing an idiot, or just some little bugs in the script.
I tried the newest release aswell as the source, nothing.

Sound attach to a entity

Is your feature request related to a problem? Please describe.
So im trying to make something like a car radio as well as boombox styled things you can pickup and walk around with but the problem with this is i cant just use the entities net id as its not the same per player so i have to use the coords currently but this makes it where i cant move the boombox/car or the sound name would then be invalid how can i solve this i was thinking if i could just attach it to the item it might be easier

Describe the solution you'd like
if i could attach the sound to the entity it could allow me to use a different name possibly for the boombox/car radio

Describe alternatives you've considered
Not really many tbh im stuck on how to fix this issue unless i can get help

Additional context
nothing else

PlayUrl volume setting not working.

After doing some test, the volume argument in PlayUrl do not work well.
I did some test setting the value to 0 / 1 / 10 / 50, whatever i do the sound will still be played at max volume. i added a consol.log to check if the value was seded and yes it is, the volume is just ... not changing ^^

getSharedObject

Describe the bug
The Bug is normal with old Ressources it tells that xsound is using old getSharedObject from ESX
The new ESX definition is exports['es_extended']:getSharedObject()

Should be quickly fixxed but i couldn't find it in your resource.

Thanks ;)

To Reproduce
Steps to reproduce the behavior:

  1. Start the resource with esx version 1.9.1
  2. See error

Expected behavior
No error

Title grapper

Function to fetch title of a youtube video, usefully for queueing up multiple tracks and getting there repective titles.

sorry, but ain't working

client.lua:

xSound = exports.xsound

local musicId
local playing = false
Citizen.CreateThread(function()
Citizen.Wait(1000)
musicId = "music_id_" .. PlayerPedId()
local pos
while true do
Citizen.Wait(100)
if xSound:soundExists(musicId) and playing then
if xSound:isPlaying(musicId) then
pos = GetEntityCoords(PlayerPedId())
TriggerServerEvent("myevent:soundStatus", "position", musicId, { position = pos })
else
Citizen.Wait(1000)
end
else
Citizen.Wait(1000)
end
end
end)

RegisterCommand("playmusic", function(source, args, rawCommand)
local pos = GetEntityCoords(PlayerPedId())
local songs = { "https://www.youtube.com/watch?v=Cub8V9DXApI", "https://www.youtube.com/watch?v=6Dh-RL__uN4", "https://www.youtube.com/watch?v=XbGs_qK2PQA","https://www.youtube.com/watch?v=r_0JjYUe5jo"}
playing = true
TriggerServerEvent("myevent:soundStatus", "play", musicId, { position = pos, link = (songs[math.random(#songs)]) })
end, false)

RegisterNetEvent("myevent:soundStatus")
AddEventHandler("myevent:soundStatus", function(type, musicId, data)
if type == "position" then
if xSound:soundExists(musicId) then
xSound:Position(musicId, data.position)
end
end

if type == "play" then
    xSound:PlayUrlPos(musicId, data.link, 1, data.position)
    xSound:Distance(musicId, 20)
end

end)

server.lua

RegisterNetEvent("myevent:soundStatus")
AddEventHandler("myevent:soundStatus", function(type, musicId, data)
TriggerClientEvent("myevent:soundStatus", -1, type, musicId, data)
end)

fxmanifest.lua

fx_version 'adamant'
game 'gta5'

server_scripts {
'server/main.lua',
}

client_scripts {
'client/*.lua',
}

Soundcloud

Soundcloud support would be nice to get added.

Playing a sound twice is not working

Not sure what I am doing wrong but if I call twice:
xSound:PlayUrlPos('car_lock', './sounds/car_lock.ogg', 1, GetEntityCoords(vehicle))
xSound:Distance('car_lock', 10)

I only hear it the first time and I must restart the resource for it to work again of change the sound name

seekTo() is not an function

Describe the bug
While using setTimeStamp for any time amount I get:
"[ 2729922] [b2802_GTAProce] CrBrowserMain/ Uncaught TypeError: this.yPlayer.seekTo is not a function (@xsound/html/scripts/SoundPlayer.js:320)"
and also
"[ 2730032] [b2802_GTAProce] CrBrowserMain/ Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'. (:0)" when I open log file.

To Reproduce
Steps to reproduce the behavior:
xsound = exports.xsound
xsound:PlayUrl("localCar", url, 0.3, true)
xsound:setTimeStamp("localCar", 30)

Expected behavior
Seek to timestamp after playing

Screenshots
image

Additional context
I saw the #38 issue and I have ensured that I am using xsound-1.4.3
I also tried to research on the YouTube iframe and found this:
player.seekTo(seconds:Number, allowSeekAhead:Boolean):Void
So I tried to edit SoundPlayer.js to be:
this.yPlayer.seekTo(time, true);
but that didn't change the error.

Youtube sound URLs no longer play on 1.4.2

Describe the bug
On 1.4.1 and below, I've been using the server exports to play sounds from direct URLs on youtube. After updating to 1.4.2 to get the memory leak fixes, I can no longer play URLs.

To Reproduce
Steps to reproduce the behavior:

RegisterCommand('test', function(source)
    exports['xsound']:PlayUrl(source, 'test', 'https://www.youtube.com/watch?v=_4kHxtiuML0', 0.02, true)
end)

Expected behavior
The sound should play on the source client. On 1.4.1, the sound plays, on 1.4.2, it does not.

Dobble response

Describe the bug
onPlayEnd dobble posts when a track has ended, not 100% sure why this is.

Play on client

feature request - Play url only on one client - so i can play music into one players headphones

Lagging music at fast speeds

I am having an issue in my server. The Phone we're using is GKS Phone. Once you get over 100 mph the phone music starts to lag and cut out. It only gets worse the faster you go. I reported it to them (GKS Phone), they stated it is an issue with xsound on the coords updating. Would I need to update the refresh rate in config or what steps should I take on fixing this?

code example in readme

Is your feature request related to a problem? Please describe.
i dont understand how to use this script.

i try:
exports.xsound:PlayUrl("test", "https://www.youtube.com/watch?v=zud9LiIS7IQ&ab_channel=GamerBoy1999999", 1.0)
exports.xsound:PlayUrl("test", "http://xsound/html/sounds/demo", 1.0)
exports.xsound:PlayUrl("test", "https://xsound/html/sounds/demo", 1.0)
exports.xsound:PlayUrl("test", "http://xsound/html/sounds/demo.ogg", 1.0)
exports.xsound:PlayUrl("test", "https://xsound/html/sounds/demo.ogg", 1.0)

(demo.ogg is added in the resource directory)
(no changes in config)
(i try this in RedM -> manifest updated)

but nothing of them play the sound

Describe the solution you'd like
a code snipped with an example how to use this script in your readme or would be very helpful.

Describe alternatives you've considered

Additional context

Copyright Songs

How can i listen to Copyrighted songs... The most songs are copyrighted wich means i cant even use this library

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.