Re: Question on MTCoreAudio
Re: Question on MTCoreAudio
- Subject: Re: Question on MTCoreAudio
- From: Michael Thornburgh <email@hidden>
- Date: Mon, 5 Mar 2007 22:40:55 -0800
-[MTCoreAudioDevice streamDescriptionForChannel:forDirection:] will
only report the logical format that's delivered to your IOProc/
IOTarget. when accessing through the streams, you can query/set both
the logical and physical sides of the stream. when using
MTCoreAudio, the logical side will (or should) always be the
canonical format (native endian 32 bit floating point, interleaved).
although you *can* change the physical format, you probably
shouldn't, as that's system wide, and should be controlled by the
user through, usually, Audio Midi Setup. note that changing the
logical sample rate will also change the system wide physical sample
rate, which you should also not ordinarily do. if you need a
different sample rate, you should use an AudioConverter.
summary direct answer to your first question: both answers are
correct -- you were asking different questions. :)
regarding the timestamp question -- i can't authoritatively answer
that, but i'm sure other folks on the list can. the timestamps
(among many other things) are transparently passed through directly
from the CoreAudio HAL, so i would expect you to see exactly the same
behavior with or without MTCoreAudio.
-mike
On Mar 5, 2007, at 3:45 AM, Mark Munte wrote:
Hello Michael,
I've tried sending you this email directly, but I keep getting mail
delivery failures. So I'm trying to reach you via the CoreAudio list.
I've spent some time with MTCoreAudio, trying to understand how it
works (without much knowledge on CoreAudio), and well, it's great!
I have found one inconsistency though (or perhaps it's missing
knowledge on my side)...
I have set up my device (standard line-in), got it's first stream
from the streams array, and set the stream description to my
desired format (16 bit signed integer 2 channel little endian).
To verify that the change to the stream was applied correctly, I'm
checking my device's delegate
audioDeviceStreamDescriptionDidChange:forChannel:forDirection and
outputting some info there.
Now, If output the information via
MTCoreAudioStreamDescription *streamDesc [device
streamDescriptionForChannel:theChannel forDirection:theDirection];
I'm getting a wrong stream description (not the one I did set).
That was my first choice as it contains exactly the same parameters
as supplied to the delegate.
But if I get the description using
MTCoreAudioStream *stream = [[device
streamsForDirection:kMTCoreAudioDeviceRecordDirection]
objectAtIndex:0];
MTCoreAudioStreamDescription *streamDesc = [stream
streamDescriptionForSide:kMTCoreAudioStreamPhysicalSide];
I get the correct one, as I set it.
Now, which information is right? What will the device output?
I am also confused about the inInputTime->mSampleTime for my input
device IO procedure. For the first buffer, it is returning a
negative number. Here's a short log for the first few buffers:
-237.000000
4173.000000
8583.000000
12993.000000
The difference between the buffers is always 4410, what matches the
devices buffer size I'm setting with [inputDevice
setDeviceBufferSizeInFrames:4410];
But was does the negative value actually mean? Shall I ignore the
first buffer or does it contain valid data?
I would really appreciate some help. Best regards
Mark
_______________________________________________
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