cool edit pro 2 1中文版-怎么设置拍一拍
![amr文件](/uploads/image/0539.jpg)
2023年3月31日发(作者:objective c)
java实现amr转MP3
1.引包jave-1.0.2(此包集成了⾳频转化⼯具)
2.代码实现
publicclassChangeAudioFormat{
publicstaticvoidmain(String[]args)throwsException{
change();
}
publicstaticvoidchange(){
Filesource=newFile("E:");
Filetarget=newFile("E:3");
AudioAttributesaudio=newAudioAttributes();
Encoderencoder=newEncoder();
ec("libmp3lame");
EncodingAttributesattrs=newEncodingAttributes();
mat("mp3");
ioAttributes(audio);
try{
(source,target,attrs);
}catch(IllegalArgumentExceptione){
tackTrace();
}catch(InputFormatExceptione){
tackTrace();
}catch(EncoderExceptione){
tackTrace();
}
}
}
执⾏结果可以看到转化完成,但会在控制台报⼀个错误,不过不影响结果(此⽅法在win10上亲测有效,linux上可能需要注意⽂件夹路径
可以使⽤相对路径以及需要⼿动声明存储图⽚的⽂件夹读写权限为任何⼈可读可写:例如:chmod777D://picture)
更多推荐
amr文件
发布评论