简体   繁体   English

如何检测音频文件格式

[英]How to detect audio file format

I wanted to know if there any java api that could identify the type of format the audio file is. 我想知道是否有任何Java api可以识别音频文件的格式类型。

I know one way is by extension,but even when the extension is wrong, I should be able to find the type of audio file 我知道一种方法是通过扩展名,但是即使扩展名错误,我也应该能够找到音频文件的类型

您可以尝试看看Java Sound API ,那里有AudioSystem静态方法:

AudioFileFormat format = AudioSystem.getAudioFileFormat(new File("music.mp3"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM