How to decode MP3 in Android within app?

前端 未结 3 592
暗喜
暗喜 2020-12-18 01:04

I\'m currently working on an app that lets the user choose an MP3 audio file. The file is then processed by my app.

For this processing, the application would need t

3条回答
  •  余生分开走
    2020-12-18 01:46

    To my knowledge, there is no Android-provided way to decode MP3s.

    I've used JLayer in the past, and can recommend it for MP3 processing. Using the NDK with a c++ library might be faster, but if you're looking to keep it Java, that's what I'd use. It's still faster than real-time, roughly 30 seconds to decode all frames in an average bitrate 3 minute MP3. That's with an Galaxy S(1GHz), so any newer phones are faster.

    As far as licensing goes, I can't help you there. JLayer itself is LGPL, but the world of MP3 licensing is murkier than used motor oil. After a few days of searching for a concrete answer, I just gave up and did it. The world at large seems divided on who even holds the license in the first place.

提交回复
热议问题