Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

186
Vistas
How to put sounds from the internet on html

I'm trying to put sounds and music on my program, this code works just fine when I call it as long as I have the archive downloaded on my pc, I want to know if there is a way to play it by a direct link from the Internet or something else so i don't need its archive downloaded.

function music() {
    var musics = ["archive.mp3"]
    for(var i = 0;i<musics.length;i++){
        var music =new Audio(musics[z])
        music.play()
    }
}

I tried putting URLs on the place of the archive and even other formats but I can't get it to work, when I try to put an URL from YouTube/SoundCloud/some open sound libraries for example and it says no supported source is found.

It seems like the same problem as this guy who didn't get any response:Java - Playing a Sound file from the Internet

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could use the HTML <audio></audio> tag and add the source of your audio clip, as seen in the example below.

If you want more examples, check out this link

I hope this helps you.

<audio controls autoplay>
  <source src="https://assets.mixkit.co/sfx/preview/mixkit-arcade-retro-game-over-213.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda