Sn00py Posted September 12, 2018 Posted September 12, 2018 How i am able to play a soundfile with that cef framework? 2 Solutions i testes will not work... <script> var audio = new Audio('login.mp3'); audio.play(); </script> <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
MrPancakers Posted September 12, 2018 Posted September 12, 2018 function playAudio(name, volume) { audioPlayer = new Audio("./directory/filename.ogg"); audioPlayer.volume = volume; audioPlayer.play(); } That example was posted in the discord, never tried it but it should work. You can also only use .ogg format, no other sound format will work. I know you posted this in another thread, but did you test in your own browser to see if it works?
Sn00py Posted September 13, 2018 Author Posted September 13, 2018 I tested in Browser and it works, i tested in Game Client and Nothing happend.
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