5

将 Com4j 与 iTunes 一起使用,将各种文本值添加到 IITrack 对象没有问题,但如果我尝试添加艺术品

if(iTunesTrack.artwork().count()==0)
{
  String path = new File(new File(song.getFilename()).getParent(),"folder.jpg").getPath();
  if(Files.exists(Paths.get(path)))
  {
      iTunesTrack.addArtworkFromFile(path);
  }
}

它失败了

11/05/2017 18.24.56:BST:com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges:updateITunesLibTrackFromSong:SEVERE: 无法更新 ItunesTrack C:\Users\Paul\Desktop\TestMusic\WAV\Music\Choir of Trinity College\Carols来自 Trinity\27 - In Dulci Jubilo (organ solo).wav:8000ffff 灾难性故障:灾难性故障 com4j.ComException: 8000ffff 灾难性故障:灾难性故障:.\invoke.cpp:517 at com4j.Wrapper.invoke(Wrapper.java: 187) 在 com.sun.proxy.$Proxy57.addArtworkFromFile(Unknown Source) 在 com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateITunesLibTrackFromSong(WindowsUpdateItunesWithChanges.java:611) 在 com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.addEditedTrack(WindowsUpdateItunesWithChanges .java:646) 在 com.jthink。songkong.ituneshelper.WindowsUpdateItunesWithChanges.analysisFiles(WindowsUpdateItunesWithChanges.java:277) at com.jthink.songkong.ituneshelper.WindowsUpdateItunesWithChanges.updateItunes(WindowsUpdateItunesWithChanges.java:180) at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java: 182) at com.jthink.songkong.ituneshelper.UpdateItunesWithChanges.call(UpdateItunesWithChanges.java:32) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 原因:com4j.ComException: 8000ffff 灾难性故障:灾难性故障:.\invoke.cpp:517 at com4j .Native.invoke(Native Method) at com4j.StandardComMethod.invoke(StandardComMethod.java:35) at com4j.Wrapper$InvocationThunk.call(Wrapper.java:356) at com4j.Task.invoke(Task.java:50) at com4j .ComThread.run0(ComThread.java:172) 在 com4j.ComThread.run(ComThread.java:153)

COM4j 接口是从我的 iTunes 版本构建的,因此它们存在,我不知道我是否做错了什么或者它是否坏了,我已经尝试过许多 jpog,结果都相同。我检查文件是否存在,如果尝试添加不存在的文件,则错误确实不同。

4

0 回答 0