Search code examples
androidcross-platformopenalportaudiolibpd

Cross platform library for mobile microphone in iOS or Android


I'm developing an app in Android, that records a voice from a microphone and sends it over WIFI. For recording I use Audiorecord and Audiotrack. Because Android doesn't provide a low latency, I was looking for an audio library, which provide low latency and are cross platform capable for a later iOS implementation.

Right now I stopped by:

  • libpd
  • portaudio
  • OpenAL Soft

My questions are:

  1. Which of those libs is most recommended or easier to implement in my case? maybe any implementation examples?

  2. When I broadcast a raw Audio data, which i recorded via Audiorecord, how can i filter own Audio-packets, which I produced? Should I send an ID with each Audio packet and filter by Auditrack?

thx Vikkes


Solution

  • I've been looking into this question for a couple days now, and honestly I've found that everywhere I look into low latency android recording, there doesn't seem to be a consistent outcome for all android versions, nor even consistencies between physical devices.

    This article was published as recently as Nov 2015 and details pretty well what I've been able to find as a whole with low latency recording with Android.

    As far as what library to use, and what is considered to be easiest is opinion really, and not what SO normally handles. Personally I use OpenAL for my projects, but latency hasn't been an issue for me. If it were, I'd probably opt for portaudio because it would be easier to integrate Steinberg's ASIO drivers which would make Windows development easier. For OSX, core audio does not seem to require the same type of drivers for low latency that Windows does.

    So to answer your question, I don't believe that any of the libraries listed would work low latency for every OS. No matter which one you use you'll probably have to support platform specific functionality.

    The article I listed does suggest that there is a paid for library, however, which may work, but since I have not used it, I can't form an opinion on it.