Skip to content

Instantly share code, notes, and snippets.

-(NSString*)descriptionForAudioFormat:(AudioStreamBasicDescription) audioFormat
{
NSMutableString *description = [NSMutableString new];
// From https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/ConstructingAudioUnitApps/ConstructingAudioUnitApps.html (Listing 2-8)
char formatIDString[5];
UInt32 formatID = CFSwapInt32HostToBig (audioFormat.mFormatID);
bcopy (&formatID, formatIDString, 4);
formatIDString[4] = '\0';