Search code examples
iphoneobjective-caudiocore-audioaudioqueueservices

How to check whether a music is playing or paused in AudioQueue


I am using AudioQueueStart for playing music and AudioQueuePause for pausing. Is there any way in AudioQueues to check whether the music is playing or not, I want to Pause music only if it is playing.


Solution

  • Check the kAudioQueueProperty_IsRunning property with AudioQueueGetProperty.

    Or seeing as you're the one stopping and starting the queue, just remember the state you set and act accordingly.