• 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:49:17 +0700

Ok have you if it has even gone into the outputcallback? like put an NSLog there or something to check if it does call the callback.

On Fri, Jan 28, 2011 at 4:45 AM, Kasper Welner <email@hidden> wrote:
I tried it. Doesn't make any difference.

What happens is that I hear the initial 1.5 seconds of audio (from the initial callback to prime the buffers for playback), then silence. The program doesn't crash but I have a IKImageView that gets garbled. Don't know if it has anything to do with it...

I have put the code in a class, which I initialize and send -start to in my AppDelegate's -applicationDidFinishLaunching:

All the setup is done in -init.

This is the callback:

static void MyAQOutputCallback(void *inUserData,
  AudioQueueRef inAQ,
  AudioQueueBufferRef inCompleteAQBuffer)
{
MyPlayer *aqp = (MyPlayer*)inUserData;
if (aqp->isDone) return;


UInt32 numBytes;
UInt32 nPackets = aqp->numPacketsToRead;
CheckError(
  AudioFileReadPackets(aqp->playbackFile,
false,
&numBytes,
aqp->packetDescs,
aqp->packetPosition,
&nPackets,
inCompleteAQBuffer->mAudioData),
  "AudioFileReadPackets failed");


if (nPackets > 0)
{
inCompleteAQBuffer->mAudioDataByteSize = numBytes;
AudioQueueEnqueueBuffer(inAQ,
inCompleteAQBuffer,
(aqp->packetDescs ? nPackets : 0),
aqp->packetDescs);
aqp->packetPosition += nPackets;
} 
else 
{
CheckError(AudioQueueStop(inAQ, false), "AudioQueueStop failed");
aqp->isDone = true;
AudioQueueDispose(inAQ, TRUE); 



}



}




 _______________________________________________
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

References: 
 >AudioQueue run loop newbie question (From: Kasper Welner <email@hidden>)
 >Re: AudioQueue run loop newbie question (From: Samuel Kitono <email@hidden>)

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