Skip to content

Instantly share code, notes, and snippets.

@milesegan
Created March 19, 2011 23:26
Show Gist options
  • Save milesegan/877903 to your computer and use it in GitHub Desktop.
Save milesegan/877903 to your computer and use it in GitHub Desktop.
c99 designated initializer example
AudioStreamBasicDescription fmt = (AudioStreamBasicDescription) {
.mChannelsPerFrame = 1,
.mBytesPerFrame = sizeof(int16_t),
.mBytesPerPacket = sizeof(int16_t),
.mFramesPerPacket = 1,
.mBitsPerChannel = sizeof(int16_t) * 8,
.mFormatID = kAudioFormatLinearPCM,
.mSampleRate = 44100.0,
.mFormatFlags = kAudioFormatFlagIsBigEndian |
kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment