【问题标题】:How to retrieve thumbnail picture of an mp3 file using java如何使用java检索mp3文件的缩略图
【发布时间】:2018-12-24 18:07:07
【问题描述】:

我在使用 java 获取 mp3 文件缩略图时遇到问题,例如我们有文件:

File MP3File = new File(<directory>);

那么,我怎样才能找回它的缩略图呢?

感谢您的关注,任何想法都将不胜感激。

【问题讨论】:

    标签: java mp3 thumbnails


    【解决方案1】:

    尝试从 mp3 文件中获取元数据,参见 github 中的 mp3agic

    根据教程,我认为您可以获取一个 byte[] 并转换为 bufferedImage。

    【讨论】:

      【解决方案2】:

      这样的事情可能会奏效:

      Image icn=((ImageIcon) FileSystemView.getFileSystemView().getSystemIcon(new File(<directory>))).getImage();
      icn = icn.getScaledInstance(32,32, Image.SCALE_SMOOTH);
      

      【讨论】:

      • 谢谢,这行得通,但我怎样才能将 java.awt.image 转换为 java.scene.image.image 以便在图像视图中显示它?
      • 我不能 100% 确定,因为我无法在我的系统上测试这个,但你可以看看这个:stackoverflow.com/questions/30970005/…
      猜你喜欢
      • 2020-09-26
      • 2012-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多