Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question on MTCoreAudio



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:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.