I need to convert the recorded audio file which is in 3gp format to mp3 format. Any suggestions pls.
Asked
Active
Viewed 8,982 times
2 Answers
3
Rather messy, but you could try this:
- Use isobox4j (see https://contributions.coremedia.com/isobox4j/wiki/IsoParser) to read the AMR audio out of the 3gp file.
- 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.
1
Converting format may be a difficult thing.
I created a project to make it easy.
https://github.com/dadiyang/jave
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.

Shine Huang
- 159
- 1
- 4
-
1How can we use this library in android ?? I have tried to add this `implementation 'com.github.dadiyang:jave:1.0.6'` dependency to my android project but it is not resolving. (I have added mavenCentral to my repositories) – Kalpesh Kundanani Jan 11 '20 at 08:12
-
@KalpeshKundanani did you find any solution ? – hio Apr 23 '20 at 10:33
-
@ParthPitroda Yes I solved this problem but not in Android project, I uploaded my recording to server without making any changes to it and on server I used ffmpeg to convert it to mp3. It may not be the solution to the problem but this thing worked for me. – Kalpesh Kundanani Apr 23 '20 at 11:37
-
@KalpeshKundanani thank you. here my friend do same thing right now :) – hio Apr 23 '20 at 11:48