• 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
Audio queues synchronization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Audio queues synchronization
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Documentation missing
  • Next by Date: Re: Audio queues synchronization
  • Previous by thread: Re: Documentation missing
  • Next by thread: Re: Audio queues synchronization
  • Index(es):
    • Date
    • Thread