Kapricioza 0 Posted September 11, 2018 Hello, I'm trying to play custom music in game using CEF, but It only works when audio is very short (less then 10s). I'm using .ogg format and this code: function playAudio() { let myAudio = new Audio("sampel.ogg"); myAudio.play(); myAudio.volume = 0.1; } Is there any limit to using custom songs? Share this post Link to post Share on other sites
Robson 2 Posted September 11, 2018 (edited) Hello Kapricioza 11 minutes ago, Kapricioza said: Hello, I'm trying to play custom music in game using CEF, but It only works when audio is very short (less then 10s). I'm using .ogg format and this code: function playAudio() { let myAudio = new Audio("sampel.ogg"); myAudio.play(); myAudio.volume = 0.1; } Is there any limit to using custom songs? Have you try to use myAudio.load(); before play? I already warn you that I'm not sure if still gonna work cuz chrome had some policy changes with audio. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes Edited September 11, 2018 by Robson Share this post Link to post Share on other sites
Kapricioza 0 Posted September 11, 2018 (edited) I try with myAudio.load(), but it is still not working Edited September 11, 2018 by Kapricioza Share this post Link to post Share on other sites
Robson 2 Posted September 12, 2018 (edited) 1 hour ago, Kapricioza said: I try with myAudio.load(), but it is still not working So the CEF build is already updated. For the best result I would suggest you to go with https://wiki.rage.mp/index.php?title=Client-side_functions#Audio Edited September 12, 2018 by Robson 1 Share this post Link to post Share on other sites