Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!