开发者

Preload sounds played via iPhone AudioServices

开发者 https://www.devze.com 2022-12-13 22:08 出处:网络
I b开发者_JAVA技巧uilt an iPhone app using AudioServices to play short sounds.The first time a sound is played, there\'s a delay of half a second or so while the sound loads before it plays.This defin

I b开发者_JAVA技巧uilt an iPhone app using AudioServices to play short sounds. The first time a sound is played, there's a delay of half a second or so while the sound loads before it plays. This definitely makes for an awkward user experience.

Is there a way to preload sounds for AudioServices to play, or do I need to switch to audioQueues or some other method of playing sounds?

Thanks, Maha


This is a well known problem. Everything in AudioServices is initialized lazily.

I think that your best choice is between Core Audio or OpenAL. OpenAL might be overkill, but it has a simple API. The oalTouch example is a good place to start.

Core Audio is a bit more raw, but it's well documented. The iPhone's OpenAL SDK is built on top of it.

0

精彩评论

暂无评论...
验证码 换一张
取 消