Re: Audio Queue metronome
Re: Audio Queue metronome
- Subject: Re: Audio Queue metronome
- From: William Stewart <email@hidden>
- Date: Wed, 30 Jun 2010 15:21:22 -0700
On Jun 30, 2010, at 1:27 PM, Evan Olcott wrote:
>
> On Jun 30, 2010, at 3:07 PM, William Stewart wrote:
>
>> The time stamp that you use with an audio queue is the time when the sample is submitted to the hardware (from AudioQueue Get Current Time). This gives you just as much idea of when the sample will be heard as from an audio unit. (You look at the host time of that time stamp, so you can then relate the time of when the sample is played to when you need to draw).
>>
>> These time stamps are how video playback is synchronised, so if there is any inherent problem here like you describe, that would be a major problem for the system.
>
> But wouldn't it be true that if you're pre-building audio queue buffers with timestamps that any changes in the UI that would affect the audio stream won't take effect until those buffers are presented?
Yes, so either don't schedule too far ahead, or you can do a Reset on the queue (to flush any existing, unplayed, state out, but this doesn't change the time line, etc), so that should be fairly innocuous
>
> For example, if you change the level or sound of a particular metronome click, those changes won't be audible until those buffers have passed through the queue and reach the hardware, which could be a few seconds later...
>
AudioQueueSetParameter takes affect immediately
> For video syncing, this technique is fine since the presentation is predetermined and there is no user input (outside of start/stop and an overall volume change), but this is different.
Same issues though - start/stop needs to be responsive, changing the volume, etc...
>
> Am I correct or am I also unaware of how Audio Queue is working? (I am admitting to a bit of ignorance to Audio Queues, I tried them for OS 2.0 and quickly abandoned them since...)
AQ gives you the ability to schedule buffer playback, but also gives you enough controls that you can make this a very responsive API.
Bill
_______________________________________________
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