Ruby mp3 Id3 解析
目前我正在从事一个音乐项目,处理用户 mp3 上传。 问题是我找不到适用于所有文件的 id3 库。 我尝试过 id3-ruby 和 Mp3Info 库,但它们都没有给我一致正确的结果。 例如,最常见的问题:
- 错误的流参数(比特率和采样率,有时是持续时间)
- 不支持扩展标签
我决定添加一个表单,用户可以在其中提供可选信息,例如艺术家和标题; 这有一点帮助,但并没有完全解决问题。
ruby 中最有用、最强大的 ID3 库是什么?
Currently I'm working on a music project, dealing with user mp3 uploads. The problem is that I can't find an id3 library that will work correctly for all files.
I have tried id3-ruby
and Mp3Info
libs but none of them gives me consistently correct results.
For example, most common problems:
- wrong stream parameters (bitrate and sample rate, sometimes duration)
- doesn't support extended tags
I decided to add a form, where users can supply optional information like Artist and title; that helped a little, but didn't completely solve the problem.
What's the most usable and powerful ID3 library for ruby?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
http://www.hakubi.us/ruby-taglib/
我将其用于一个项目而且效果很好。 taglib 的包装,非常便携。
http://www.hakubi.us/ruby-taglib/
I used this for a project and it worked quite well. Wrapper around taglib, which is very portable.
我用过这个:
http://ruby-mp3info.rubyforge.org/
或
gem install ruby-mp3info
(为 Mac 或 *nix 添加规则sudo
)有一些 rdoc 文档,很好。 不利的一面是,我不太喜欢使用大写字段名称,这似乎太担心保留规范中的名称。 也许我应该破解一些别名。 不管怎样,这个示例脚本会扫描我的音乐库并计算标题中的单词数:
I've used this:
http://ruby-mp3info.rubyforge.org/
or
gem install ruby-mp3info
(add the regulationsudo
for Mac or *nix)There's some rdoc documentation, which is nice. On the downside, I don't much like the use of upper-case field names, which seems too concerned to preserve the names from the spec. Maybe I should hack in some aliases. Anyway, this sample script scans my music library and counts words in titles:
截至 2019 年,最佳答案是:
所有其他库都早已无人维护。
Krists Ozols 的 ID3Tag 区分特征
Moumar 的 ruby-mp3info 区分特征
taglib-ruby 区分特征
As of 2019, the best answers are:
All other libraries are long-since unmaintained.
Krists Ozols' ID3Tag distinguishing characteristics
Moumar's ruby-mp3info distinguishing characteristics
taglib-ruby distinguishing characteristics
http://id3lib-ruby.rubyforge.org/
我特别喜欢这个,你也可以将标签写入文件。
http://id3lib-ruby.rubyforge.org/
I particularly liked this one, you can also write tags to the file.
id3tag
是另一种选择。 例子:id3tag
is another option. Example: