Hardware accelerated audio decoding with OpenAL
Asked Answered
D

2

6

Is it possible to use the iPhone's hardware accelerated decoding of mp3s and AAC when using the OpenAL library?

I suppose there are two possible approaches if this is possible.
iPhone specific OpenAL extensions.
iPhone APIs to decode audio into raw bytes.

I have two specific use cases.

  • Completely decode a short sound bite.
  • Piecewise decode a larger sound file so it can be streamed into OpenAL rather than loaded all at once.

update

Boy! no one's got an answer for this? Does Apple's NDA stiffle these kinds of questions? What's going on? Surely someone else using OpenAL has wanted better audio performance.

Denigrate answered 7/10, 2010 at 6:41 Comment(0)
G
6

There is at least one hardware (or hardware assisted) decoder in all iPhone device models. It can be accessed to convert mp3 and AAC files into raw PCM bytes by using the Audio Queue Services API. From thence you can process those bytes or send them to OpenAL.

Grueling answered 19/10, 2010 at 21:33 Comment(1)
Not exactly what I was looking for. I would have liked some example calls into the API. At least now I have better keywords to google.Denigrate
T
-1

AFAIK, there is no hardware audio decoder in the iPhone, 3S, and 3GS. This might have changed in the iPhone 4, but I have not heard anything to make be believe so.

Tiloine answered 17/10, 2010 at 20:30 Comment(3)
I think you're wrong. I can't find anything official but there is lots of discussion online about preferring mp3's over ogg when targeting the iPhone. Mp3's are faster to load(decode) and consume less battery. Both of those seem to imply mp3 hardware.Denigrate
@caspin or they could imply a less-than-optimal ogg encoding/decoding algorithm compared with the mp3 algorithm. Your hypothesis is certainly plausible but not required for the claims you are seeing.Exenterate
@caspin Apologies for getting this wrong. I found the reference from which my mistaken impression was derived: Greenstone, Brian. "Jedi Master List for Game Optimization." iPhone Games Projects. Ed. David Mark. Berkeley, CA: Apress, 2009. Print. From the “Audio Optimization” topic: “The iPhone and iPod touch are audio devices, and as such, you’d think that they have a lot of awesome audio hardware in them to make audio playback inexpensive, but this is not the case. The iPhone actually has very limited audio hardware, and most of the audio processing is actually done in software.”Tiloine

© 2022 - 2024 — McMap. All rights reserved.