开发者

Is there any way I can rate songs in iTunes using java?

I have a list of songs rated by folder they are in开发者_JAVA技巧 (e.g. 1 star songs in a folder, 2 star songs in another folder and so on). I want to rate songs in iTunes depending on which folder they are in, fast and automatically using codes from java.


I found a perl script that does similar thing: http://www.hydrogenaudio.org/forums/index.php?showtopic=38083

It would make it event simpler to use folder name instead of tags to set rating.

If you want to do similar thing in java, you'd have to use Jacob (example here) or BridJ to do access iTunes database via COM. It's painful, platform-dependant and I wouldn't recommend doing it unless you really need it.


iTunes stores its library as an XML file so I suppose you could manipulate that directly from within Java. Of course you'd have to be careful with this approach as different versions of iTunes have different XML formats, and if you invalidate the library than all the metadata iTunes is holding about the tracks in its library will be lost.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜