Re: AudioDeviceRead and AUGraph
Re: AudioDeviceRead and AUGraph
- Subject: Re: AudioDeviceRead and AUGraph
- From: Luke Bellandi <email@hidden>
- Date: Wed, 3 Dec 2003 18:33:42 -0800
Hi Robert,
On Dec 3, 2003, at 5:44 AM, Robert Grant wrote:
I'm using the AudioDeviceManager class from the PlayEffect sample code
to bring live audio into my AUGraph and it's working nicely except for
one thing. If the graph is left running for a long time (like 12
hours) a noticeable latency is gradually introduced.
Are you using a different device for input than for output? If so,
your clocks are likely drifting.
I think this is because there is no connection between the graph's
time and the AudioDeviceRead time. In the PlayEffect sample code the
inTimeStamp from the graph is ignored and the AudioDeviceManager
maintains its own TimeStamp.
You could introduce code to monitor the timestamp deltas for both the
graph and device. Pick one as the master clock, and stretch/compact
samples on the slave to align with the master. Although I believe the
last shipped PlayEffect had code that did this?
I'm not sure why that is, but plugging in the AUGraph timestamp (from
an AURender callback) does not help in fact it causes the
AudioDeviceRead to produce silence (but no error code).
Right. the AUGraph's 0 timestamp is relative to the graph's start
time, while the device's 0 timestamp is relative to its start time.
Accordingly, the timestamps are more than likely unaligned. It's not
surprising you're getting silence (if the timestamps are more than a
few milliseconds apart) since AudioDeviceRead's valid window (as
described in AudioHardware.h) is relatively narrow.
Luke
Thanks for any insight,
Robert.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.