Audio queues synchronization
Audio queues synchronization
- Subject: Audio queues synchronization
- From: Nunzio <email@hidden>
- Date: Thu, 9 Apr 2009 13:05:14 +0200
Hi everyone,
this is my first post here. I'm from Italy and I'm developing an app
for the iPhone. In this app, I'd like to play two audio tracks and
they should play at the same start time; I read that someone here had
the same question, and he was told to use mHostTime of the
AudioTimeStamp, as it is the mach_absolute_time. I'm just questioning
HOW to do this; I tried to modify the speakHere sample, in which I
used AudioQueueEnqueueBufferWithParameters instead of
AudioQueueEnqueueBuffer; the second-last parameter is an
AudioTimeStamp that I declared before; so, in AQPlayer.mm, I have:
if (THIS->mCurrentPacket==0) {
AudioTimeStamp aTimestamp;
OSStatus resultGetCurrentTime = AudioQueueDeviceGetCurrentTime(inAQ,
&aTimestamp);
AudioQueueEnqueueBufferWithParameters(inAQ, inCompleteAQBuffer, 0,
NULL, 0, 0, 0, NULL, &aTimestamp, NULL);
} else {
AudioQueueEnqueueBuffer(inAQ, inCompleteAQBuffer, 0, NULL);
}
because I want to set the startTime only with the first buffer of data.
What I don't get is the use of the timestamp: I mean, I am making the
queue start at the currentTime of the hardware, right? What I would
like to do is to make the queue start some time AFTER the current
time, in order to allow the two queues to start together. How could I
do that? Is there something I am missing? Sorry for the lack of
knowledge here, but I really can't get to understand this with just
the audio queue services documentation.
Thank you very much
Nunzio
_______________________________________________
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