开发者

Converting 3gp/amr audio file to mp3 in java

开发者 https://www.devze.com 2023-03-07 05:10 出处:网络
I need to convert the recorded audio file which is in 3gp format to mp3 for开发者_开发问答mat. Any suggestions pls.Rather messy, but you could try this:

I need to convert the recorded audio file which is in 3gp format to mp3 for开发者_开发问答mat. Any suggestions pls.


Rather messy, but you could try this:

  1. Use isobox4j (see https://contributions.coremedia.com/isobox4j/wiki/IsoParser) to read the AMR audio out of the 3gp file.
  2. Use one of the options listed in How to encode a WAV to a mp3 on a Android device to encode it.

Never used isobox4j: started working with it but moved on to a different project before I was done but it looks like it will give you something that looks like raw PCM that you can encode.

Let me know if it works for you.


Converting format may be a difficult thing.

I created a project to make it easy.

https://github.com/dadiyang/jave

English Documentation Here

This tool is mainly used to convert the AMR to MP3 format for playing in the audio tag of HTML5. It wrapper ffmpeg, and make it has cross platform feature.

The only thing you should do is:

Inclue Maven Depandency

<dependency>
    <groupId>com.github.dadiyang</groupId>
    <artifactId>jave</artifactId>
    <version>1.0.0</version>
 </dependency>

And Invoke AudioUtils.amrToMp3 Method Just 3 lines, JAVE make it extraordinary easy.

public void amrToMp3()  {
    File source = new File("testAudio.amr");
    File target = new File("testAudio.mp3");
    AudioUtils.amrToMp3(source, target);
}

It's worth a try. May it helps for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号