媒体文件的播放次数?

发布于 2024-12-18 17:49:36 字数 414 浏览 4 评论 0原文

我想从外部存储查询元数据。使用 ContentProvider 就非常简单了。但我还想获取 mp3 文件的播放次数。

我研究了 scrobble droidsubsonic 但我没有找到一种方法来检索播放计数(如果存在)。 (例如Winamp 支持它。)

如果有PC,有没有办法获取它?

I want to query meta data from the external storage. That's pretty straight forward with the ContentProvider. But I also want to get the play count of the mp3 file.

I looked into projects like scrobble droid and subsonic but I didn't find a way to retrieve the Play Count if it's there. (e.g. Winamp supports it.)

Is there a way to get the PC if it's there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾夏年华 2024-12-25 17:49:36

您可以手动读取 ID3 标记并检查 playcount 属性,但请记住,如果这是针对您自己的媒体播放器应用程序,则每次播放时都必须修改该文件(加载它,修改 ID3 标签,保存更改)我认为这会效率低下,充其量会消耗电池。此外,很少有其他媒体播放器实际上这样做(Winamp,据我所知,似乎是少数之一),因此如果使用股票媒体播放器或任何其他媒体播放器播放,它不会是准确的播放计数不修改 ID3 标签的媒体播放器。

大多数跟踪播放次数的媒体播放器(iTunes、Zune 等)都是通过维护一个以播放次数作为属性的数据库来实现的。显然,这在媒体播放器之间不可移植,但对于您自己的实现,我建议使用数据库作为您的解决方案。

You could manually read in the ID3 tags and check for a playcount attribute, but keep in mind, if this is for your own media player application, you'll have to modify the file each time it is played (load it, modify the ID3 tag, save the changes) which I imagine would be inefficient and a battery drain at best. Also, very few other media players actually DO this (Winamp, from what I see, seems to be one of the few), so it's not going to be an accurate playcount if played with, say, the stock media player, or any other media player which does not modify the ID3 tag.

Most media players that track playcounts (iTunes, Zune, etc.) do so by maintaining a database with playcount as an attribute. Obviously this is not portable between media players, but for your own implementation, I would suggest a database as your solution.

苯莒 2024-12-25 17:49:36

我遇到了同样的问题,但找到了一些解决方案。因此,Android 不提供数据,但音乐播放器可以存储此信息。我做了什么:
* 反编译的音乐应用程序
* grep清单文件寻找提供商
* 利润

该解决方案并不完美,但我认为没有其他方法可以在未root的设备上获取此信息。

I faced the same problem but found some solution. So, android does not provide the data but music players could store this info. What I did:
* decompiled music app
* grep manifest file looking for provider
* profit

The solution is not perfect but I think there is no other ways to get this information on not rooted device.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文