Is there anyway to get ID3 metadata from an MP3 or Vorbis comments from Ogg via the HTML5 audio element?

扶醉桌前 提交于 2019-11-29 15:41:52

问题


Mozilla Developer Center's HTML5 media guide describes an event for audio and video elements called "loadedmetadata". Is there anyway to get the metadata for files? I am writing an HTML5 extension for Google Chrome and I don't know what the metadata for the audio files I'm creating a player for beforehand.

Edit: This question seems to be kicking everyone's ass. :/


回答1:


According to this you can use filereader.readAsBinaryString(file); to get the binary data of the ID3 tag.

filereader.readAsBinaryString(file); will asynchronously return a binary string with each byte represented by an integer in the range [0..255]. This is useful for binary manipulations of a file’s data, for example to look for ID3 tags in an MP3 file, or to look for EXIF data in a JPEG image.



来源:https://stackoverflow.com/questions/2244806/is-there-anyway-to-get-id3-metadata-from-an-mp3-or-vorbis-comments-from-ogg-via

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!