5

I am recording audio from mic and save it to .mp4 - it is AMR format. How to convert this audio to mp3 or AAC? I saw this post and I did not understand it - I am new in android.

Is there some easy library for android that can work with mp3? I googled whole day and not found nothing. Maybe some good man can explain and give full example in this post and hundreds of people will be grateful!

Thank you.

Community
  • 1
  • 1
Evgeny Borzenkov
  • 1,107
  • 3
  • 12
  • 19

2 Answers2

0

You could do that with http://www.javazoom.net/mp3spi/mp3spi.html probably. I am not sure where you were looking for help, but there are tons of articles on StackOverflow about that. You don't have to search for android only stuff. You are using java.

Ex: Any good recommendations for MP3/Sound libraries for java?

MP3 Encoding in Java

http://openinnowhere.sourceforge.net/lameonj/

Community
  • 1
  • 1
Nathan Tornquist
  • 6,468
  • 10
  • 47
  • 72
  • for example your last link: http://openinnowhere.sourceforge.net/lameonj/ - it is separate convertor for windows as I understand, but I need convert audio file right in my android app not separetely. Can you give example of code using of some library how to conver some file audio.mp4 to audio.mp3 ? – Evgeny Borzenkov May 23 '12 at 20:37
  • I have no idea what you are asking. – Nathan Tornquist May 23 '12 at 20:39
  • Those are libraries referenced by the various Stack Overflow articles that exist about this topic. I was just searching for you, because you seemed to be having trouble getting results. I don't have example code. You'll have to read about them on your own. And that isn't a windows specific converter. It's a library. You can import it into your app and use it. – Nathan Tornquist May 23 '12 at 20:46
  • 4
    All these libraries cannot convert default android audio format(AMR codec) to MP3 or AAC. It is cool: too difficult get correct answer on stackoverflow last time - because there are many men that just search posts with same tags and give links instead answer. It is sad.. Your answer did not help. – Evgeny Borzenkov May 24 '12 at 10:46
0

Can you avoid recording to AMR (which is lossy format), and record raw PCM samples instead? Then sending those PCM samples directly into AAC or MP3 encoder would give you much better quality. Doing first AMR and then AAC looses information twice.

Danijel
  • 8,198
  • 18
  • 69
  • 133