MaRvZ Posted April 1, 2019 Posted April 1, 2019 Hey there, is there a way to play custom sound sounds with this function? mp.game.audio.playSoundFrontend Or is there another way to play custom sounds in RAGE? Greets MaRvZ
Kar Posted April 2, 2019 Posted April 2, 2019 Use CEF, https://www.w3schools.com/jsreF/dom_obj_audio.asp
Jorge Santamaria Posted April 2, 2019 Posted April 2, 2019 43 minutes ago, Kar said: Utilice CEF, https://www.w3schools.com/jsreF/dom_obj_audio.asp I have been searching and I have found this as an example: <!DOCTYPE html> <html> <body> <h3>A demonstration of how to access a AUDIO element</h3> <audio id="myAudio" controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> <p>Click the button to get the duration of the audio, in seconds.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myAudio").duration; document.getElementById("demo").innerHTML = x; } </script> </body> </html> Would you know how to make some example of code to show us? It would be very helpful
MaRvZ Posted April 3, 2019 Author Posted April 3, 2019 I tried it like so: <audio id="sound" controls> <source src="../sound.ogg" type="audio/ogg"> <source src="../sound.mp3" type="audio/mpeg"> <source src="../sound.wav" type="audio/wav"> Your browser does not support the audio element. </audio> <button onclick('startsound()')>Play Sound</button> <script> function startsound() { document.getElementById('sound').play(); document.getElementById('sound').loop = true; } </script> In my desktop browser it works all fine. But in GTA CEF-Browser is shows up like this: Seems that the sound could not be loadet from cef browser. 1
Division Posted April 3, 2019 Posted April 3, 2019 try to use absolute paths. Maybe debug your cef to see, which folder "../" is for real.
MaRvZ Posted April 3, 2019 Author Posted April 3, 2019 how to debug my ? ../ is my root folder from the client ressource
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now