Manipulating audio properties in HTML / JS

-2

Myteacherpassedaprojecttomakeanaudioplayer,andforthatIwasinspiredbyRdioMusic,thereinmyplayerIwasplanningwhenIopenedanaudioheuploadedtheimage(correspondingtothecoverofthealbumthatisalreadyembeddedinthe.mp3)intheplayer,butalreadyIresearchedandIdonotknowhowtodo,doesanyonehaveanyidea?

    
asked by anonymous 14.11.2018 / 20:35

1 answer

0

You can use a lib called jsmediatags , with which you can capture the file information, even the artwork.

You use the following form, you can see other forms in the link I passed and if you want to know how lib works, I recommend looking at the code in github.

var jsmediatags = window.jsmediatags;
jsmediatags.read("http://www.example.com/music-file.mp3", {
  onSuccess: function(tag) {
      console.log(tag);
  },
  onError: function(error) {
      console.log(error);
  }
});
    
19.11.2018 / 20:48