Re: AudioOutputUnit and timestamps
Re: AudioOutputUnit and timestamps
- Subject: Re: AudioOutputUnit and timestamps
- From: Kurt Revis <email@hidden>
- Date: Sat, 27 Apr 2002 16:42:39 -0700
On Saturday, April 27, 2002, at 11:42 AM, Bill Stewart wrote:
on 27/4/02 1:29 AM, Kurt Revis wrote:
* My sound format is 16 bits per sample, stereo, 44.1k. This means that
there are 4 bytes per frame. The input callback is given a buffer which
is 2048 bytes in length, which is thus 512 frames (or 1024 samples).
However, in the timestamps that I am given, the only valid field is
mSampleTime, and it increases by only 256 each time my callback is
called. I would expect 512 (or maybe even 1024, although that's
stretching it)--why is it different?
This implies that a sample rate conversion is being done for you. Are
you
sure that you've set the input format of the output unit:
AudioUnitSetProperty -> where the kAudioUnitProperty_StreamDescription
(set
on input scope and the elementID I would guess of 0) should be getting
set.
Yes, I am setting that (I think you meant
kAudioUnitProperty_StreamFormat). In this particular case the AU should
be doing a format conversion (from two's complement to floating point)
but not a sample rate conversion--the file is 44.1k and so is the device.
(I just checked with a 22.050k file, which would require rate
conversion, and I get similar weird results. In that case, the AU asks
for 1024 bytes of data, which is 256 frames. However, its timestamp->
mSampleTime increases by 128 each time.)
As well... Currently, when any conversion is being done by the output
unit
it isn't passing through the host time field. We have fixed this in
Jaguar.
Great! Since I can't do anything useful with these timestamps right now,
I will ignore them for now and see what happens in Jaguar. (Or try
using the AudioConverter myself, as in the example code.)
Thanks!
--
Kurt Revis
email@hidden
_______________________________________________
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.