Hi,
I'm working on a cross platform mobile OS media player and doing some
research into Realtime audio playback on Android at the moment. It seems
there is a fairly small amount of info online and a lot less fully
fledged code examples than available for the iPhone platform. For
example I have already implemented my demo app in objective-C but it
looks like it is going to be significantly more effort to do the same
for Android.
I have found a couple of interesting posts and articles about the
current state things. Maybe people round here would like to comment on
the situation?
Here's what I have found so far:
1: There are three main API's - mediaPlayer, SoundPool, AutdioTrack
with openSL ES in the works for release sometime in the near future.
2: All of the Android API's do not provide true low latency support and
have varying bugs that need to be worked around with native code. The pd
team have made some progress on the workarounds based on jack style
callback wrapper classes.
3: There is no standard library for decoding audio file formats at the
lower level. Although several options exist including native java
implementations for mp3 (JLayer), and custom code from developers like
Ivan Memruk from
mindtherobot.com
4: There is no native midi or OSC support and it looks like there is no
LV2 or ladspa port at this point either. There are very few open source
demo apps available which provide a complete solution for media playback
and recording at low latency. It seems that the pd implementation is the
only one.
Overview:
http://www.wiseandroid.com/post/2010/07/13/Intro-to-the-three-Android-Audio…
http://mindtherobot.com/blog/555/android-audio-problems-hidden-limitations-…
<http://mindtherobot.com/blog/555/android-audio-problems-hidden-limitations-and-opensl-es/>pensl-es/
<http://mindtherobot.com/blog/555/android-audio-problems-hidden-limitations-and-opensl-es/>
Sample code:
http://mobiledeviceprogramming.blogspot.com/2010/10/fun-with-android-audiot…
http://mindtherobot.com/blog/580/android-audio-play-a-wav-file-on-an-audiot…
http://mindtherobot.com/blog/624/android-audio-play-an-mp3-file-on-an-audio…
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-fo…
Workarounds / Middleware:
http://gitorious.org/pdlib
http://www.typhon4android.org/
Cheers.
--
Patrick Shirkey
Boost Hardware Ltd.