Hacker News new | ask | show | jobs
by bsder 3207 days ago
The API is frustrating because it is meant to hide the fact that Android audio sucks giant hairy donkey balls.

If you give Web developers access to raw samples, they are going to expect it to work. When it doesn't on Chrome on Android, lots of people are going to start complaining and filing bugs.

So, instead of fixing the audio path, they decided to bury its crappiness under a "higher-level" API which has fuzzier latency and can be built with hacks in the audio driver stacks themselves.

4 comments

Android audio is truly terrible for instrument apps. I don't understand how it suffices for things like games. I also don't understand why people even bother to make things like pianos and drum set… The latency is so extreme and inconsistent that even on recent phones they are useless. In contrast, iOS has had excellently playable instruments at least as far back as the iPod Touch 4.
Here's an interesting video on this topic back from 2013: https://youtube.com/watch?v=d3kfEeMZ65c
That... explains why Google was so keen to kill off the Audio Data API Mozilla proposed, I guess.
But Chrome for Android didn't come out until 2012 and Chris Rogers started the Web Audio work in 2009. I think someone would have had to have been exceptionally farsighted to think "Android's audio stack is going to suck for several years so we need to design around that now".
At that point in time, though, you could be forgiven with "Sheesh. Javascript is so painfully slow that nobody will ever pass PCM samples around in it."

So, at every point in time up to and including now, you've always got something resisting low-latency PCM. Android is just the latest reason.

Side note: it looks like Chris Rogers bowed out of Web Audio about 2012/2013 timeframe.

You couldn't really, since AudioData worked pretty well.

Also, it was obvious JS perf would get better and better.

Ah, good point. I should have checked better on things before commenting!
This has been a known issue with Android since at least 2009 (~2,700 stars); work done to address this is starting to trickle out this year.

https://issuetracker.google.com/issues/36908622

AAudio is a new C API. It is designed for high-performance audio applications that require low latency. It is currently in the Android O developer preview and not ready for production use. (Jun 2017)

There are not a lot of artists at Google.

Until this changes, the media apis will lag as G attempts to maintain parity with other orgs. Google makes product for Google devs and incidentally for the world to use.

Aha, I had that eerie feeling that I saw those crappy patterns somewhere else. So, Android it was