Hi
I use AudioQueueOffline render to convert mp3 into PCM, I then do some
processing and use a second AudioQueue to play back.
I am running into a strange problem trying to loop audio. Everything
works fine as long as I do not try to loop. Basically I set up the queue with
several input buffers. I calculate the total number of audio frames and keep a
running total of the number of frames returned by AudioQueueOfflineRender. I
never request more than the total number of frames.
When looping is on, my queue callback function hits the EOF condition
long before the total numbers of frames returned by AQOfflineRender equals the total
audio frames. This is expected I use several input buffers. The audio output
continues to play. I can see my queue callback function is called several times
reading from the beginning of the audio file and is enqueueing correctly.
Eventually, the system stops calling my queue callback function. I put
some test code in that call AudioQueueGetProperty( kAudioQueueProperty_IsRunning
) it shows that my queue is still running!!! My playback code keeps
looping calling AudioQueueOfflineRender(), how ever all I get is silence.
Listening to the play back it sound like the song plays exactly once.
You can find a code listing at https://devforums.apple.com/thread/11240?tstart=0
I used afinfo utility program to double check that my application
is correctly calculating the total number of packets and the total number of
audio frames. I even put some test code in that makes sure I do not request the
1000 frames from AudioQueueOfflineRender, but this does not seem to help
You can find a code listing on https://devforums.apple.com/thread/11240?tstart=0
Any idea how I debug this ? Is there any way to look into the queue
state?
Thanks
Andy
p.s. I am doing all my testing using OS 2.2.1 and the simulator