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

Re: Audio queues synchronization


  • Subject: Re: Audio queues synchronization
  • From: Doug Wyatt <email@hidden>
  • Date: Thu, 9 Apr 2009 05:51:50 -0700

On Apr 9, 2009, at 4:05 , Nunzio wrote:
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.

Unfortunately, scheduling buffers via the host time is not implemented. You can however start two queues at the same time by passing the same timestamp to AudioQueueStart.


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.

Pick some amount of time a little bit in the future, say, 0.5 seconds. Then:


#include "CAHostTimeBase.h" // from CoreAudio PublicUtility
double secondsInFuture = 0.5;
UInt64 now = CAHostTimeBase::GetTheCurrentTime();
UInt64 hostTicksInFuture = (UInt64)(secondsInFuture * CAHostTimeBase::GetFrequency());
AudioTimeStamp startTime;
startTime.mFlags = kAudioTimeStampHostTimeValid;
startTime.mHostTime = now + hostTicksInFuture;


Doug

_______________________________________________
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: Nunzio <email@hidden>
    • Re: Audio queues synchronization
      • From: Nunzio <email@hidden>
References: 
 >Audio queues synchronization (From: Nunzio <email@hidden>)

  • Prev by Date: Audio queues synchronization
  • Next by Date: Re: AudioQueueEnqueueBuffer error !act after call interruption and pause/resume
  • Previous by thread: Audio queues synchronization
  • Next by thread: Re: Audio queues synchronization
  • Index(es):
    • Date
    • Thread