Search code examples
iosaudioffmpegcore-audio

Audio alternative to FFmpeg - Core Audio IOS


I have been using FFmpeg Android for a music app I'm working on. I built a custom audio engine from stratch with C++ and FFmpeg and it works amazing and it fulfilled all my needs. However, Due to FFmpeg being Lgpl lisence, it seems to me after some researching it is not possible to use a lgpl lisence due to app stores policy. Im not a lawyer or have the money to hire a lawyer for a commercial advise. So I am thinking to replace ffmpeg with another audio decoder, processor library. I am planning to feed the custom decoded data to audio devices through Apples core audio library.

Here are my needs:

  • Need to decode ogg files
  • Need to encode pcm data as aac file
  • Need to add post process FX to decoded data such as low pass filter etc

So what I am asking for is an answer to one of the following:

  • Could FFmpeg really not be used in app store due to lgpl static linking issues? (I looked at the most famous apps that use FFmpeg on Android, all of them does not use FFmpeg on IOS)
  • If I were to use another library for FFmpeg what is the best alternative to work with? Did anyone actually had experienced the same situation that I am in?

I also tried using AudioKit but it has a critical problem that does not meet with my requirement so I dropped it.

I am looking for advice here. Thanks!


Solution

  • Need to decode ogg files

    You can use this public domain Ogg vorbis decoder.

    Need to encode pcm data as aac file

    You can do that with Apple's Audio Converter APIs.

    Need to add post process FX to decoded data such as low pass filter etc`

    • If all you need is a couple of DSP algorithms, you can look at Musicdsp.org, which includes a collection of algorithms from the Music-DSP mailing list, such as low-pass filters, etc.
    • STK includes several audio DSP algorithms in C++, and has a permissive license.
    • This repository offers several implementations of the Moog Ladder filter, most of them are closed-source friendly.