http://www.sauronsoftware.it/projects/jave/download.php
以上是获取所需jar包 maven获取不到
例子:
File file = new File("http://nigualsizhuo.sanqifenshe.cn/1568602545078.amr")
Encoder encoder = new Encoder();
long ls = 0;
MultimediaInfo m;
try {
m = encoder.getInfo(source);
ls = m.getDuration()/1000;
} catch (Exception e) {
System.out.println("获取音频时长有误:" + e.getMessage());
}
return ls;
还有一个页面,那边比较全一点
https://blog.csdn.net/qq_34288630/article/details/85836152