How to retrieve thumbnail picture of an mp3 file using java

有些话、适合烂在心里 提交于 2019-12-13 04:21:55

问题


I have problem getting mp3 file thumbnail using java, for example we have file:

File MP3File = new File(<directory>);

So, How can i retrieve its thumbnail?

Thanks for your attention, any ideas would be appreciated.


回答1:


Something like this might work:

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



回答2:


Try to get the metadata from the mp3 file, see mp3agic from github.

According from the tutorial, I think you could get a byte[] and convert into a bufferedImage.



来源:https://stackoverflow.com/questions/51374592/how-to-retrieve-thumbnail-picture-of-an-mp3-file-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!