• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioQueue run loop newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioQueue run loop newbie question


  • Subject: Re: AudioQueue run loop newbie question
  • From: Samuel Kitono <email@hidden>
  • Date: Fri, 28 Jan 2011 04:17:16 +0700

That might be the problem, try these lines:
    AudioQueueNewOutput(asbd,
                        HandleOutputBuffer,
                        &playerState,
                        CFRunLoopGetCurrent(),
                        kCFRunLoopCommonModes,
                        0,
                        &playerState.mQueue);

see if it can work now without the while loop

On Fri, Jan 28, 2011 at 4:13 AM, Kasper Welner <email@hidden> wrote:
I just wanted to add to the post that I am aware that the AudioQueue is supposed to run in its own separate thread automatically as long as AudioQueueNewOutput is passed NULL for inCallbackRunLoop and CallbackRunLoopMode arguments. It's just not happening for some reason...

On Jan 27, 2011, at 13:46 PM, Kasper Welner wrote:

This is my first post on this mailing list. 

I just began learning about AudioQueues from the CoreAudio book (rough cuts).
I did the AudioQueue playback example tutorial, which is basically the same as the apple tutorial example. Everything is working fine.
The problems start when I try to implement the code in an app with a GUI. I tested it by pasting the code into the 'init' method of a NSObject subclass. The only way I can get the queue to do the callback is by inserting an empty DO...WHILE loop in the end of my init, but that makes the GUI freeze (obviously...)!!
I studied the Speak Here example, and tried to find a loop of some kind or a CFRunLoopRunInMode but, it basically looks like everything just works as soon as AudioQueueStart is called... Is this stuff working in a different way on the iOS (compared to OSX)?

Clearly, there is something fundamental that I don't understand about how things work... 

Kasper


@implementation KWPlayer

-(void) start
{
CheckError(
   AudioQueueStart(queue, NULL),
   "AudioQueueStart failed");

printf("Playing...\n");
do {

} while (0 == 0);            WHY IS THIS MAKING IT PLAY???
}
@end


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: AudioQueue run loop newbie question
      • From: Kasper Welner <email@hidden>
References: 
 >AudioQueue run loop newbie question (From: Kasper Welner <email@hidden>)
 >Re: AudioQueue run loop newbie question (From: Kasper Welner <email@hidden>)

  • Prev by Date: Re: latency on sidechain bus
  • Next by Date: Re: AudioQueue run loop newbie question
  • Previous by thread: Re: AudioQueue run loop newbie question
  • Next by thread: Re: AudioQueue run loop newbie question
  • Index(es):
    • Date
    • Thread