• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: old mtcoreaudio code doesn't work now
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: old mtcoreaudio code doesn't work now


  • Subject: Re: old mtcoreaudio code doesn't work now
  • From: Stephen Davis <email@hidden>
  • Date: Sat, 12 Jan 2008 14:41:04 -0800

On Jan 12, 2008, at 2:02 PM, John Draper wrote:

dudley ackerman wrote:

On Jan 9, 2008, at 11:42 AM, Mark Pauley wrote:

shtoomDescription.mFormatID = kAudioFormatLinearPCM;
shtoomDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsBigEndian | kAudioFormatFlagIsNonInterleaved;

In addition to Michael's suggestions, I would suggest that you switch to using kLinearPCMFormatFlagIsNativeEndian... unless you're writing to a file of known endian-ness.


_Mark

i am taking in the data and using a gsm codec for which i have source code and doing a byte swap for the intel endian issue.
you see i am not using that shtoom description in my leopard code -- the current version of MTCoreAudio doesn't take the destination device as a parameter.
so, i am confused as to how to get 16bit output from MTConversionBuffer.
backing up a step -- i don't understand 'frames'. i am going to have to think a bit deeper to straighten this out.
I ran across a very good doc from Apple by reading this list. I sent you the link... but it describes a "frame" as a single Byte. But in MY interpretation of a Frame is from the GSM Perspective. Which in this case is 130 bytes compressed, or 1280 bytes (640 16 bit values) uncompressed.

Some definitions of CoreAudio-speak are:

frame = one sample in time (i.e. one tick of the sample rate clock) across all channels
packet = one compressed blob of data which, when decoded, turns into N frames of PCM audio (e.g. your 130 compressed bytes)


For uncompressed PCM formats, the number of packets = number of frames. In other words, every packet contains 1 frame of audio.

I think this is described pretty well in the header comments for AudioStreamBasicDescription in <CoreAudio/CoreAudioTypes.h>.

It takes getting used to since most of the ISO/MPEG codec descriptions use "frame" instead of "packet". There are various reasons for why it is the way it is in CoreAudio-speak.

hth,
stephen
_______________________________________________
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


References: 
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: Michael Thornburgh <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: Michael Thornburgh <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: Michael Thornburgh <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: Michael Thornburgh <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: Mark Pauley <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: dudley ackerman <email@hidden>)
 >Re: old mtcoreaudio code doesn't work now (From: John Draper <email@hidden>)

  • Prev by Date: SMPTE parsing algorithm?
  • Next by Date: Re: old mtcoreaudio code doesn't work now
  • Previous by thread: Re: old mtcoreaudio code doesn't work now
  • Next by thread: Re: old mtcoreaudio code doesn't work now
  • Index(es):
    • Date
    • Thread