BUY THIS BOOK
Add to Cart

PDF $31.99

Safari Books Online

What is this?

Looking to Reprint or License this content?

iPhone Open Application Development
iPhone Open Application Development Write Native Objective-C Applications for the iPhone

By Jonathan A. Zdziarski
Book Price: $39.99 USD
£24.99 GBP
PDF Price: $31.99

Cover | Table of Contents | Forum | Colophon


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Openal On Iphone - Issues?, OpenAL exists as a framework on iPhone, but issues seem to abound?
Batgar
post May 12 2008, 02:53 PM
Post #1


New Member
*

Group: Members
Posts: 1
Joined: 12-May 08
Member No.: 286



Note: iPhone SDK Beta 5 was used for everything below.

This is related to the iPhone Open App. Dev. book content relating to audio frameworks.

I am working on an application where I need to emit tones of set frequencies using dynamic timings, so WAV file playback is not something I can do.

On the iPhone there are many ways to do tone playback via audio buffers.

1) Follow Jonathan's great example using the Audio Queue framework, and just use dynamically generated PCM data
-- This is a good approach, but locks me into platform specific code.
2) Use Core Audio directly
-- According to Mr. Zdziarski's audio chapter, use of Core Audio is a bad idea due to hog mode issues. Are these hog mode issues fixed in iPhone OS 2.0? Or is special iPhone SDK / iPhone OS hacking needed?
3) Use OpenAL
-- According to all of the iPhone SDK documentation, OpenAL is fully supported. My guess is that OpenAL is a wrapper around Core Audio, which means that OpenAL inherits the hog mode issues within Core Audio.
-- OpenAL has the ALUT library which contains code to greatly assist me in tone generation, specifically the alutLoadMemoryWaveform call.
-- Getting ALUT to compile and run under XCode and iPhone SDK Beta 5 was trivial.

I chose to start with OpenAL on iPhone, it seems like the right thing to do from a support, cross platform, and stability perspective.

My trip down OpenAL lane with the iPhone SDK and iPhone Simulator has not been pretty.

alcOpenDevice works with no issues, and returns back an ALCDevice*. However subsequent calls to get more info about the device via alcGetString turn up empty. When I try to pull the string for ALC_DEVICE_SPECIFIER, all I get back is an empty string.

alcCreateContext calls do not return a valid ALCContext*. This means that no real OpenAL operations can occur.

Calls to the OpenAL error retrieval APIs come up empty with no error codes or error strings for the calls to alcCreateContext.

Has anyone been able to use OpenAL via the iPhone SDK (or other routes) to do audio processing?

Are the problems I am encountering in audio just a flaw in the iPhone Simulator within the iPhone SDK?

I have a feeling that what I am seeing may be the problem that Mr. Zdziarski outlines with Core Audio.

Has anyone else tried OpenAL via the iPhone SDK? What were your results / hacks?

I will try to get code up soon, but it is pretty trivial code going directly against the OpenAL.framework headers.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 28th August 2008 - 01:11 AM