• 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
AudioQueue and buffer underflows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioQueue and buffer underflows


  • Subject: AudioQueue and buffer underflows
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 20 Mar 2008 15:51:31 -0700

I'm using AudioQueue and AudioFileStream to play MP3 streams received from a TCP socket. It's working fine, except when network issues cause the incoming stream to fall far enough behind the queue that I can't satisfy the queue's request for buffers. Then the queue just stops playing anything, and I don't know how to recover.

Specifically, the queue's behavior seems to be that, when its callback returns n times in a row without enqueueing any data (where n is its number of buffers), it stops producing audio. But there's no programmatic indication that it's stopped — I have a property-listener callback on kAudioQueueProperty_IsRunning, and it doesn't get called.

So two questions:

1. What's the best way to detect that the queue's stopped playing because of an underrun? Just counting the number of buffers I fail to enqueue doesn't seem reliable.

2. After an underrun, once I can catch up and buffer some data, how do I get the queue going again? Do I need to stop, prime and start it?

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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 and buffer underflows
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Creating custom sheets
  • Next by Date: App hanging in AudioQueueStop
  • Previous by thread: Re: Creating custom sheets
  • Next by thread: Re: AudioQueue and buffer underflows
  • Index(es):
    • Date
    • Thread