state of the art

200 views
Skip to first unread message

Jamie

unread,
Nov 5, 2010, 3:01:14 AM11/5/10
to Android Music Developers
I am looking for knowledgeable comments regarding this recent email I
received.

Q: I'm happy to see the Amazing Slow Downer has been ported to the
smart phone (iPhone) platform. When might I see it available for my
Android smart phone?

A: There is no way to do any low level audio programming with the
current version (2.3) of the Android operating system (at least not
that I know of). When it comes to audio, Apple is light years ahead of
Google. This makes it impossible to do a software similar to the
Amazing Slow Downer. Newer version of the Android OS may change this
but for now it looks as iPhone will rule the market for this kind of
applications.

The program mentioned alters the speed of the audio source without
changing the pitch.

Alex

unread,
Nov 5, 2010, 4:33:24 AM11/5/10
to Android Music Developers
Hi Jamie,

I disagree that it makes it impossible, but there's some truth in A's
answer- Apple isn't light years ahead, but it's definitely a couple of
miles down the road. I presume by "low level audio programming," A
means that there is no native API for audio, which is correct. If you
want to write audio stuff in a compiled language you have to route it
back into Dalvik and java before it can be heard. This adds
complexity to any app you'd like to write, but there are coping
strategies to get around it. Martin Roth wrote a good overview here:

http://groups.google.com/group/android-music-developers/browse_thread/thread/f81136cf413311c7

In practical terms, there is also a degree of latency for audio
streams in Android that are used in this way. This can be a blocking
issue for any application which requires realtime responsiveness, and
maybe that is the barrier that A has hit.

In even more practical terms, you can write a timestretch app for
Android and I've done it (using SuperCollider). I'll try to package
it up and post source+APK at some time during the weekend so you can
see for yourself what the latency is like.

Alex

Martin Roth

unread,
Nov 5, 2010, 5:55:28 AM11/5/10
to android-musi...@googlegroups.com
I'd like to second what Alex has said, but perhaps make a stronger
statement. There is absolutely no truth to the idea that "there is no
way to do any low level audio programming" in Android. It is true that
there is no native Java interface to do so. All of the audio code must
be written in C/C++ and accessed via JNI/NDK. But for all practical
purposes, there is nothing that you can do on the iPhone that you
can't do on Android. What Alex has said about Android having more
latency is indeed true, but it really only becomes a problem if you
want really low latency. Again, for most practical applications, with
a latency of, say, ~10ms, Android will do just fine.

Also, the assertion that "when it comes to audio, Apple is light years
ahead of Google" is also false. Apple may have made some things
easier, for instance with their whole Audio Unit infrastructure, but
there is little that you can do on Apple that is impossible to do on
Android (or almost as well).

I will admit however, that audio programming on Android might take
more knowledge, because you have to be familiar with JNI.

Jamie

unread,
Nov 6, 2010, 3:55:47 AM11/6/10
to Android Music Developers
Here is a bit more from our Swedish developer friend. I expect he
will join this forum soon and speak for himself.
===================================================================================
my first question is, how to decode one of the many possible audio
file formats such as mp3, aac, ogg, etc
I've seens no solution to this except for open source stuff
...
my biggest concern (which I did't tell you from the start) is that
Java sucks,
and Android is based on Java (programing language).

I have no problem to go down low level to C++ etc (that's what I know
the best)
but the biggest barrier is Java and as far as I know, the very high
level way of programming audio for Android.

Sorry, but they are light years behind Apple, trust me,
I've been programming for Mac and Windows for soon 20 years (Windows
is also way behind after Apple)
...
P.S. I think I will eventually give Android a try, if not for anything
else, for their claimed market share
...
How do I ask questions to that group?

It seems their answers are related to recording audio?
an app such ASD needs to process audio files alreay on the device,
is that possible?

their answers are very basic and doesn't exactly say anything except
that it's possible,
which it's of course it is else they would not be able to play any
audio files on an Android.
I'm looking for an official solution without too much hacking needed
...
>
> May I repost your reply to the Android Music Developers
> forum?

Yes, please do and if you know, how can I ask questions myself?

I know I will eventually make an Android app, I just want to know that
the plattform is mature enough,
my feelings now is that it's not (yet)?

> Or perhaps you would care to do so. My interest is mainly as a
> consumer advocate (though I've been programming since 1968, now retired)
> wishing to spur development. As you have probably heard Android Market
> now has over 100,000 apps and is projected to overtake the iPhone store
> by 2012 or sooner.

I've read that but wonder how many users have the same "wallet size"
as iPhone users?

that's a factor if deciding to make a software

siliconeagle

unread,
Nov 7, 2010, 7:23:33 AM11/7/10
to Android Music Developers
There is an example of MP3 decoding on this blog - I used it on my
masters project (a phase vocoder/music mixing app)
http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=231
He wrote a games library, libgdx, but I think he ended up using
libmpg123 (the blog post is for libmad) because of licensing issues.

You can hook into native libraries on existing android versions - but
they are not fixed between android versions so its not really
recommended, AFAIK, OpenSL(or OpenAL?) id due in the next version,
gingerbread.

I wrote a presentation on Basic NDK stuff here:
http://www.sentinelweb.co.uk/doc/RobMunro_NDK_Pres.odp

It will be presented at OpenLab(http://www.pawfal.org/openlabwiki/
index.php?page=OpenNight) next Saturday (13th Nov, London). If anyone
has any Android audio projects they are welcome to present them there
as well...

As far as Java goes - it's not for DSP, that being said, Android Java
is a lot swifter than standard Java, a lot of the Android classes are
hooked into native libraries using JNI (for example 2D graphics is a
lot faster on android than in standard Java - so even though you have
to write the UI in Java it runs quite well) and there is also JIT
optimisation so things like buffer copies in Java aren't too bad...

So while Android is behind iPhone at the moment it has to be
remembered that it is two years younger and already has roughly about
the same amount of devices in the hands of users... The market is also
behind but there are more and more solutions for selling apps, e.g.
Amazon and most telcos orange are setting up markets so there are
definitely a lot more options coming... but it's just more of a
distributed model.

best,
rob m

Martin Roth

unread,
Nov 7, 2010, 10:34:00 AM11/7/10
to android-musi...@googlegroups.com
I started on a reply, but realised then that I didn't have much to add
to the discussion right now. Siliconeagle has already talked about how
to decode MP3s. With all due respect, it sounds like the ASD
programmer is looking for excuses. At least, there are no technical
issues which would prevent him from writing an Android app. But I
agree with him that he must decide where to invest his time, and that
is another issue all-together.

===

> my biggest concern (which I did't tell you from the start) is that Java sucks,

This is a religious statement, not a technical one.

> Android is based on Java (programing language).

This is true.

> as far as I know, [Java is] the very high level way of programming audio for Android.
All Android APIs are Java. But Android does support JNI which allows
native code to be accessed from Java.

> Sorry, but they are light years behind Apple...
This is a very subjective statement. I would agree that Android has
some catching up to do to iOS, but "light years" is a bit too strong.
In general, there isn't anything that you can do on iOS and you can't
do on Android. And that includes audio processing.

Alex

unread,
Nov 7, 2010, 11:41:56 AM11/7/10
to Android Music Developers
i couldn't make head nor tail of the light-years reference either.
the only thing i can suggest is that the g1 was released about a year
and a quarter after the iphone, and that barnard's star is around one
and a quarter light-years from alpha centauri. this makes some sense
on reflection. barnard's star is one of the oldest stars in the milky
way, much as apple is one of the longest-established brands in the
personal computing space. alpha centauri is considerably brighter
than barnard's star, which is a good analogy for android's rapid
growth in the market. and alpha centauri is a binary star system,
presumably due to fragmentation.

alex

On Nov 7, 3:34 pm, Martin Roth <mhr...@gmail.com> wrote:
> I started on a reply, but realised then that I didn't have much to add
> to the discussion right now. Siliconeagle has already talked about how
> to decode MP3s. With all due respect, it sounds like the ASD
> programmer is looking for excuses. At least, there are no technical
> issues which would prevent him from writing an Android app. But I
> agree with him that he must decide where to invest his time, and that
> is another issue all-together.
>
> ===
>
> > my biggest concern (which I did't tell you from the start) is that Java sucks,
>
> This is a religious statement, not a technical one.
>
> > Android is based on Java (programing language).
>
> This is true.
>
> > as far as I know, [Java is] the very high level way of programming audio for Android.
>
> All Android APIs are Java. But Android does support JNI which allows
> native code to be accessed from Java.
>
> > Sorry, but they are light years behind Apple...
>
> This is a very subjective statement. I would agree that Android has
> some catching up to do to iOS, but "light years" is a bit too strong.
> In general, there isn't anything that you can do on iOS and you can't
> do on Android. And that includes audio processing.
>

Friedger Müffke

unread,
Nov 7, 2010, 11:44:15 AM11/7/10
to android-musi...@googlegroups.com
Thanks for your insight! I like your post.

2010/11/7 Alex <goo...@glastonbridge.co.uk>:

--
OpenIntents UG (haftungsbeschränkt)
Suarezstraße 41
14057 Berlin
tel:+49 30 60982220
mailto:in...@openintents.biz
enum:+493060982220

Vertretungsberechtigter Geschäftsführer: Friedger Müffke
Registergericht: Amtsgericht Berlin (Charlottenburg)
Registernummer: HRB 118597
Ust-IdNr: DE265992701

Carl-Gustaf Harroch

unread,
Nov 7, 2010, 3:14:41 PM11/7/10
to android-musi...@googlegroups.com

I second that

sent from my nexus one. rock on android

Jan Berkel

unread,
Nov 8, 2010, 5:23:53 AM11/8/10
to Android Music Developers

> I  wrote a presentation on Basic NDK stuff here:http://www.sentinelweb.co.uk/doc/RobMunro_NDK_Pres.odp
>
> It will be presented at OpenLab(http://www.pawfal.org/openlabwiki/
> index.php?page=OpenNight) next Saturday (13th Nov, London). If anyone
> has any Android audio projects they are welcome to present them there
> as well...


interesting, any chance you could upload a non odp version ? (pdf,
ppt, ...)
i don't want to install open office :)

thx

jan

siliconeagle

unread,
Nov 8, 2010, 7:13:25 AM11/8/10
to Android Music Developers
http://www.sentinelweb.co.uk/doc/RobMunro_NDK_Pres.pptx

whats wrong with openoffice? just joking - i find both annoying to use
for different reasons.

light years = marketing speak.

rob m

David Slevin

unread,
Nov 8, 2010, 8:20:31 AM11/8/10
to android-musi...@googlegroups.com
Sounds interesting, 
None of the links to the NDK presentation are working for me? 

Anyone else having the same issue? 
D. 

David Slevin

unread,
Nov 8, 2010, 8:37:03 AM11/8/10
to android-musi...@googlegroups.com

Oops! There it is! 
Reading through it now... 

D. 

Rolf Nilsson

unread,
Nov 9, 2010, 4:41:37 AM11/9/10
to Android Music Developers

Is there an official API that lets you get hold of decompressed PCM
samples from any of the supported file formats?
mp3, ogg, aac, wma etc?



On 7 Nov, 13:23, siliconeagle <rrmu...@gmail.com> wrote:
> There is an example of MP3 decoding on this blog - I used it on my
> masters project (a phase vocoder/music mixing app)http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=231
> > ===========================================================================­========
> > that's a factor if deciding to make a software- Dölj citerad text -
>
> - Visa citerad text -

Nick Rudolfsky

unread,
Nov 17, 2010, 1:52:46 PM11/17/10
to Android Music Developers
Alex,

I would be very interested in seeing the timestretch app you wrote for
android if you are willing to package up the code and send it to me.
I'm working on low latency audio in android and I'm having a hard time
finding examples from people who claim it can be achieved (or at least
get pretty close). Even if you aren't processing in realtime I would
still like to see it to test out the latency. Thanks in advance!

Nick

On Nov 5, 3:33 am, Alex <goo...@glastonbridge.co.uk> wrote:
> Hi Jamie,
>
> I disagree that it makes it impossible, but there's some truth in A's
> answer- Apple isn't light years ahead, but it's definitely a couple of
> miles down the road.  I presume by "low level audio programming," A
> means that there is no native API for audio, which is correct.  If you
> want to write audio stuff in a compiled language you have to route it
> back into Dalvik and java before it can be heard.  This adds
> complexity to any app you'd like to write, but there are coping
> strategies to get around it.  Martin Roth wrote a good overview here:
>
> http://groups.google.com/group/android-music-developers/browse_thread...

Alex

unread,
Nov 22, 2010, 2:54:22 PM11/22/10
to Android Music Developers
Hey Nick,

I'm really sorry for the delay, I was kidding myself that I would find
time to tidy up the code before posting it... I've put it up here:

https://github.com/glastonbridge/vSweatLoaf/blob/master/src/com/synthulator/vsweetloaf/VSweetLoaf.java

It's a fairly straightforward example of an android app that links
against the SuperCollider Service at runtime. To see the interactions
with SuperCollider, look for where OscMessages are being created.

The timestretching routine is written in SuperCollider and compiled
into a synthdef, the source is here:

https://github.com/glastonbridge/vSweatLoaf/blob/master/superColliderSource/stretch.sc

So the structure is a little like this: vSweatLoaf connects to
SuperCollider as a Service. SuperCollider loads the SynthDef.
vSweatLoaf sends controls to the SynthDef inside SuperCollider, the
SynthDef makes noise. Please ask questions if there's anything that
doesn't make sense. I've been chasing my own tail a lot lately, need
to go on a buddhist/scala retreat or something :)

Cheers,

Alex

Nick Rudolfsky

unread,
Nov 22, 2010, 5:32:34 PM11/22/10
to android-musi...@googlegroups.com
Hey thanks a lot for the code...no worries about the delay. Unfortunately, after importing the 3 projects from your git repo and running the VSweetLoaf application, all that happened was a screen came up on my device that said "Virtual Sweet Load" on 3 different lines and nothing else. Don't worry about it, having the code is enough for me to see whats going on.

Not sure if it will help me because this seems to be doing the processing on a file whereas I need to process audio input in real time (which has proved to be quite impossible on android despite what some people have claimed). Hopefully android 2.3 will bring us good news about low latency audio!

Thanks again for the code!

Nick

Reply all
Reply to author
Forward
0 new messages