Starting OpenAL &amp; alBufferData()?

Hi, I'm new here, so please forgive any mistakes of etiquette (seems to be usually NDA related?).

--------------

Trying to get started introducing OpenAL sound into my iPhone App. Currently just running things in the simulator. I've done a bit of simple OpenAL stuff on PC before.

Just throwing together some test code, I've successfully created a device and context, buffer and source, but when I call alBufferData to fill a buffer with some noise, the call fails with an AL error message of: AL_INVALID_OPERATION

All the calls pass error checking without problems, except alBufferData().

technocrat9000 Wrote:Loading a wave file with AudioFileOpenURL, adding it to a buffer then source, and playing the source, all proceeded smoothly without problems

I can post the code if anyone wants it, although maybe noone other than me has problems with such a simple thing

I'd love to see it. I haven't been able to get OpenAL working on the simulator at all, despite having used OAL for years now. My kingdom for alutLoadWAVFile.

Does OAL even work on the simulator? The CrashLanding sample code doesn't have sound for me either on the sim. And Apple is being a pain in the ass and apparently doesn't want my $99, so I haven't been able to test on a real iPhone yet.

Bachus Wrote:Does OAL even work on the simulator? The CrashLanding sample code doesn't have sound for me either on the sim.

To get OpenAL (such as CrashLanding) to work in the sim, click on the top left of your xcode window (where it says Simulator | Debug), and make sure you select simulator 2.1 on both options. (there should be two places to set to 2.1).

I've found that the bottom setting randomly sets itself back to 2.0, so if your sound ever stops working check that first.

That's my trial-and-error solution, maybe someone can explain in more detail what these settings actually are and how to permanently edit them.

technocrat9000 Wrote:To get OpenAL (such as CrashLanding) to work in the sim, click on the top left of your xcode window (where it says Simulator | Debug), and make sure you select simulator 2.1 on both options. (there should be two places to set to 2.1).

I've found that the bottom setting randomly sets itself back to 2.0, so if your sound ever stops working check that first.

That's my trial-and-error solution, maybe someone can explain in more detail what these settings actually are and how to permanently edit them.

Hmm, weird. I set to iPhone OS 2.1 and iPhone Simulator 2.1 and I still can't get any sound in my code or CrashLanding. Metronome that uses AudioServices instead of OAL works fine.

I've got OpenAL working just fine on the actual device (didn't have to change a single line of code from my cross platform rendering engine), however it doesn't play any sound in the simulator. Not that I care that much, since it works on the actual hardware, and I do testing on desktop target anyway.