synchronizing audioqueues

Nibbie
Posts: 2
Joined: 2009.01
Post: #1
Hello, I'm not sure whether to post this here or in the iphone section. Please move it if not appropriate. I'm developing on the i-phone and I'm trying to understand how to sync two or more audioqueues.

I've used the sample code from the speakHere to define multiple queue's. I've changed the callback function to implement audioQueueEnqueueBufferWithParameters, like this:

AudioTimeStamp aTimestamp;

AudioQueueEnqueueBufferWithParameters (inAudioQueue, bufferReference, (bufferReference->mPacketDescriptions ? numPackets : 0), bufferReference->mPacketDescriptions, 0,0,0,NULL,NULL,&aTimestamp)

I also accessed the timestamp from the audioqueue, using AudioQueueDeviceGetNearestStartTime


Now I can access an AudioTimeStamp struct with all kinds of time information, but I'm in the dark how to use this information. I've red the audio sessions and queue guides from apple and searched the web for this, but haven't found any more useful information.

A little more background on what I want to achieve here. I'm trying to build a multi-track player with loops. These loops all have the same length (and of course same number of bars and bpm). I want to 'kick in' a second track while one track is running. That second track has to determine at which packet or which timestamp the first track is at that moment, so that it can start at the same packet or time index as the first track.

If anyone can shed some light on this matter, it would be very appreciated.
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.04
Post: #2
hi... same problem here. did you find out how to do this? thanks!
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.06
Post: #3
Been looking for example of this for a while...Did anyone find an answer?
Quote this message in a reply
Post Reply