Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download Audio Object through javascript

How would you download an Audio object created dynamically?

var audioPlaying = new Audio();
audioPlaying.src = link;
audioPlaying.addEventListener("loadedmetadata", function(_event) {
    audioPlaying.play();
});
like image 933
Jordan Avatar asked Apr 23 '26 09:04

Jordan


1 Answers

you could, if the audio source is shown somewhere on the website, enable the controls. audioPlaying.controls = true after which you can right-click the audio (now having the player visible on the page) and select "Save Audio As..." (tested using firefox)

like image 157
Hetorus NL Avatar answered Apr 24 '26 22:04

Hetorus NL