PDA

View Full Version : [iPhone SDK] Problem with playback audio using AudioQueue


modusNX
03-18-2008, 12:31 AM
Hello,

i have created a simple audio playback using the audio queue feature. My destination is to create background music; nothing more. If you have a look at the Apple examples, you always find the code:

do {
CFRunLoopRunInMode (kCFRunLoopDefaultMode, 0.25, false);
} while (mIsRunning);

If i put these lines in the code, then the audio is playing correctly, but the UI is not reacting! I can push no button!

What do i have to do? Do i have to created a thread? Please help! Thank you!

Godores
03-20-2008, 12:19 AM
You only need that do-while loop if you are running the code in a separate thread. The main thread already has one of those things.

So your options are either to remove the loop and see how it works, or to detach a new thread, and leave the loop in there.