当混合两个音频文件时,这段代码显示一个声音被视为立体声,另一个被视为单声道,这是为什么呢?为什么不能将它们都视为立体声?
@property (readwrite) AudioStreamBasicDescription stereoStreamFormat;
@property (readwrite) AudioStreamBasicDescription monoStreamFormat;
音频文件的检查是这样的。
if ((inputDataFormat.mFormatID == kAudioFormatLinearPCM) &&
(inputDataFormat.mSampleRate == 44100.0) &&
(inputDataFormat.mChannelsPerFrame == 2) &&
(inputDataFormat.mChannelsPerFrame == 2) &&
(inputDataFormat.mBitsPerChannel == 16) &&
(inputDataFormat.mFormatFlags == (kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger))
) {
// no-op when the expected data format is found
} else {
status = kAudioFileUnsupportedFileTypeError;
goto reterr;
}
为什么遇到该数据格式时会触发无操作条件?