Jump to content
RAGE Multiplayer Community

Custom sound with mp.game.audio.playSoundFrontend


Recommended Posts

43 minutes ago, Kar said:

I have been searching and I have found this as an example:


<!DOCTYPE html>

<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.

<p>Click the button to get the duration of the audio, in seconds.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

function myFunction() {
  var x = document.getElementById("myAudio").duration;
  document.getElementById("demo").innerHTML = x;



Would you know how to make some example of code to show us?

It would be very helpful

Link to comment
Share on other sites

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.
<button onclick('startsound()')>Play Sound</button>
  function startsound()
	document.getElementById('sound').loop = true; 

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. 

  • Like 1
Link to comment
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...