void CAAudioHardwareStream::GetAvailablePhysicalFormatByIndex(UInt32 inIndex, AudioStreamBasicDescription& outFormat) const { UInt32 theNumberFormats = GetNumberAvailablePhysicalFormats(); ThrowIf(inIndex >= theNumberFormats, CAException(kAudioHardwareIllegalOperationError), "CAAudioHardwareStream::GetAvailablePhysicalFormatByIndex: index out of range"); CAAutoArrayDelete<AudioStreamBasicDescription> theFormats(theNumberFormats); GetAvailablePhysicalFormats(theNumberFormats, theFormats); outFormat = theFormats[inIndex]; }
void CAHALAudioStream::GetAvailablePhysicalFormatByIndex(UInt32 inIndex, AudioStreamRangedDescription& outFormat) const { UInt32 theNumberFormats = GetNumberAvailablePhysicalFormats(); if((theNumberFormats > 0) && (inIndex < theNumberFormats)) { CAAutoArrayDelete<AudioStreamRangedDescription> theFormats(theNumberFormats); GetAvailablePhysicalFormats(theNumberFormats, theFormats); if((theNumberFormats > 0) && (inIndex < theNumberFormats)) { outFormat = theFormats[inIndex]; } } }