从 ID3 标签获取专辑封面/将函数从 Java 转换为 Objective-C
我有以下问题要问:
如何使用 iOS 应用程序编译 taglib?
当我将文件夹添加到我的项目中并尝试编译它时,我有点困惑,但它失败并出现 1640 错误。
我如何才能成功编译它 - 我问的原因是 taglib 允许从标签中提取专辑插图。
如果有人知道基于 Objective-C 的专辑插图提取类,那将会有所帮助 - 我不知道为什么 Apple 不在 Core Foundation 中添加执行此操作的方法 - 因为有一些方法可以从 ID3 标签中提取一些数据。
我不明白为什么没有一些 Objective-C 的方法来做到这一点。
任何帮助表示赞赏。
编辑:
经过几个小时的尝试,我发现了一个 Java 函数 here 似乎可以很好地完成工作,但我没有任何线索在如何将其转换为 Objective-C(或者更不用说 C++),因为它的类型似乎与 Objective-C/C++ 中的类型完全不同。
如果有人知道转换此方法的方法,它会真正有所帮助,因为这似乎是我的最后一个选择,因为我已经尝试了很多其他选择。
I've got the following question to ask:
How do you compile taglib with an iOS application?
I'm a bit confused as I added the folder into my project, tried to compile it, but instead it failed with 1640 errors.
How do I make it successfully compile - the reason why I ask is taglib allows for the extraction of album artwork from a tag.
If anyone knows an Objective-C based album artwork extraction class it would help - I don't know why Apple don't add a way of doing this in Core Foundation - because there are methods for extracting some of the data from an ID3 tag.
I can't see why there isn't some Objective-C way of doing it.
Any help appreciated.
EDIT:
After hours upon hours of trying to do this, I've found a Java function here that seems to do the job fine, but I haven't got a clue on how to convert it to Objective-C (or let alone C++ for that matter), as its types seem to be completely different from those that are in Objective-C/C++.
If anyone knows of a way to convert this it would really help, as this seems as my last option as I've tried so many others.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这只是上面 @hatfinch 的答案,但已修复并且现在可以工作。
This is just the answer of @hatfinch above but fixed and now working.
如果您只想访问设备上已存储的音乐作品即通过 iPod 应用程序,请查看这篇文章演示了如何使用Apple提供的现有框架(特别是MediaPlayer框架)来实现这一点。
如果没有,明智的做法是提供更多有关您想要实现的目标的信息,并提供尝试编译 TagLib 时遇到的错误的示例。
编辑:
另一种解决方案可能是使用嵌入式 webview 并使用 JavaScript 库,例如 这个 加载、解析和获取专辑封面?
If you are merely wanting to access the artwork of the music already stored on the device i.e from the iPod application, then check out this article which demonstrates how to do it using existing frameworks provided by Apple, specifically the MediaPlayer framework.
If not, it may be wise to provide a little more information about what you are trying to achieve and also provide examples of the errors you are getting when trying to compile TagLib.
EDIT:
Another solution could be to use an embedded webview and use a JavaScript library such as this one to load, parse and fetch the album artwork?
您可以使用:https://github.com/EliaCereda/TagLib-ObjC
You could use this: https://github.com/EliaCereda/TagLib-ObjC