Audio CMSampleBuffer format

looks like you can get the ASBD this way:

sampleBuffer->
  CMSampleBufferGetFormatDescription ->
    CMAudioFormatDescriptionGetStreamBasicDescription

then the ASBD will detail the frame sizes, if it is compressed, endianness, etc.

To demonstrate this (with no error checking) and get the sample rate:

CMSampleBufferRef cmSampleBuffer = ...;

CMFormatDescriptionRef formatDescription =
  CMSampleBufferGetFormatDescription(cmSampleBuffer);

const AudioStreamBasicDescription* const asbd =
  CMAudioFormatDescriptionGetStreamBasicDescription(formatDescription);

double sampleRate = asbd->mSampleRate;