安卓上MP3怎么转amr?

zyfhongyang 2019-02-19 05:43:22
安卓开发里面怎么把mp3文件转为amr文件
使用jave 报错
public static boolean Mp3ToAmr(String srcname, String targetname)
{
File source = new File(srcname); //源文件
File target = new File(targetname); //目标文件
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp3");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
try {
encoder.encode(source, target, attrs);
return true;
} catch (IllegalArgumentException | EncoderException e) {
e.printStackTrace();
}
return false;
}
...全文
705 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyfhongyang 2019-02-26
  • 打赏
  • 举报
回复
引用 3 楼 智慧雨泽 的回复:
调用api。。。。

具体些?
智慧雨泽 2019-02-25
  • 打赏
  • 举报
回复
调用api。。。。
zyfhongyang 2019-02-25
  • 打赏
  • 举报
回复
微信发送语音只支持amr,所以需要把发的 mp3文件转为amr,
服务端的转换已经搞定,但是6M需要5秒
现在放到安卓端执行转换,没有找到合适的源码

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧