通过javascript从文件夹中的mp3文件读取id3标签
我想使用 javascript 从文件夹中的 mp3 文件读取 id3 标签并将其保存到文本文件中。这可能吗?谢谢
I would like to read id3 tags from mp3 files in a folder with javascript and save it to a textfile. Is this possible? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
此人完成了解析 mp3 文件并提取标签的工作。现在由您来执行循环并将结果写入文本文件。
This man did the work of parsing an mp3 file and extracting the tags. It's now up to you to do the loop and to write the result in a text file.
NodeJS 有一个完整的 API,用于从 JavaScript 读取/写入文件。不过,我不知道有任何 mp3 库...
编辑:我假设您指的是非浏览器环境中的 JavaScript,但其他人似乎都假设您指的是网络中的 JavaScript浏览器。如果您这样做,那么您将陷入困境,直到/除非更多浏览器实现 W3C 创建的各种文件 API。 本文深入讨论了这些内容。不过,很少有浏览器实现了必要的 API。 Chrome 可能是唯一一款可以让您遍历目录的浏览器。
NodeJS has a full API for reading/writing files from JavaScript. I'm not aware of any mp3 libraries for it, though...
Edit: I assumed you meant JavaScript in a non-browser environment, but everyone else seems to be assuming you mean JavaScript in a web browser. If you do, then you'll struggle until/unless more browsers implement the various File APIs being created by the W3C. This article talks about those in some depth. There are very few browsers that have implemented the necessary APIs, though. Chrome may be the only one that lets you traverse directories.
当软件开发人员说某些事情是不可能的时,我真的很恼火。因为,这种情况很少发生……这根本超出了他们的理解力、创造力或寻求解决方案的意愿。
话虽如此(https://github.com/aadsm/JavaScript-ID3-Reader) 是某人的工作,允许从网络浏览器读取已解析的 ID3 标签。
It really annoys me when software developers say something is impossible. Because, it is rarely so... it is simply beyond their comprehension, creativity, or willingness to work for a solution.
Having said that here (https://github.com/aadsm/JavaScript-ID3-Reader) is someone's work to allow reading of parsed ID3 tags from a web browser.
适用于 Chrome 9 和 Webkit 浏览器的 Javascript,欢迎使用:
http:// /ericbidelman.tumblr.com/post/8343485440/reading-mp3-id3-tags-in-javascript
Javascript for Chrome 9 and Webkit browsers, welcome:
http://ericbidelman.tumblr.com/post/8343485440/reading-mp3-id3-tags-in-javascript
该主题在搜索结果中排在第一位。这里的答案都没有提到
TagLib
,这是最著名的一个,可作为 Nodejs 的模块:https://github.com/nikhilm/node-taglib
This topic comes first in the search result. None of the answer here mentioned
TagLib
, which is the most famous one that is available as module for nodejs:https://github.com/nikhilm/node-taglib