Jordan
Jordan

Reputation: 495

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();
});

Upvotes: 3

Views: 3479

Answers (1)

Hetorus NL
Hetorus NL

Reputation: 46

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)

Upvotes: 1

Related Questions