Re: Audio queues synchronization
Re: Audio queues synchronization
- Subject: Re: Audio queues synchronization
- From: Doug Wyatt <email@hidden>
- Date: Fri, 10 Apr 2009 08:06:53 -0700
Unfortunately the Start timestamp is ignored on input queues, in
2.2.1, though it's been looked at since...
Doug
On Apr 10, 2009, at 3:52, Nunzio <email@hidden> wrote:
Hi everyone,
I followed what Doug said and I successfully made the playback queue
start with a delay. I created the timestamp and passed it to
AudioQueueStart, as the second parameter.
Unfortunately, I cannot make this work on a recording queue: I use
the same code... I create the timestamp and pass it to
AudioQueueStart, on the recording queue... I'm using 10 seconds of
delay for test, and I'm seeing that what the microphone catches
within ten seconds from the moment I start recording, is written to
the output file; I would expect that the buffer starts to be filled
10 seconds after I press "record", but that's not happening.
Am I missing something?
Thank you in advance,
Nunzio
Il giorno 09/apr/09, alle ore 14:51, Doug Wyatt ha scritto:
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