Sign in to follow this  
Sn00py

Play a soundfile ?!

Recommended Posts

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> 

 

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.