6

मुझे निम्नलिखित एएसबीडी को समझने में सहायता चाहिए। यह RemoteIO के ताजा उदाहरण के लिए असाइन किया गया डिफ़ॉल्ट ASBD है (मुझे इसे ऑडियो इकाई पर AudioUnitGetProperty(..., kAudioUnitProperty_StreamFormat, ...) निष्पादित करके प्राप्त किया गया है, इसे आवंटित करने और इसे प्रारंभ करने के ठीक बाद)।रिमोट I/O ऑडियोस्ट्रीम बेसिक डिस्क्रिप्शन (एएसबीडी) को समझना

Float64 mSampleRate  44100 
UInt32 mFormatID   1819304813 
UInt32 mFormatFlags  41 
UInt32 mBytesPerPacket 4 
UInt32 mFramesPerPacket 1 
UInt32 mBytesPerFrame  4 
UInt32 mChannelsPerFrame 2 
UInt32 mBitsPerChannel 32 
UInt32 mReserved   0 

सवाल है, नहीं mBytesPerFrame8 होना चाहिए? यदि मेरे पास प्रति चैनल 32 बिट्स (4 बाइट्स) हैं, और प्रति फ्रेम 2 चैनल हैं, तो प्रत्येक फ्रेम 8 बाइट लंबा नहीं होना चाहिए (4 की बजाय)?

अग्रिम धन्यवाद।

उत्तर

0

मेरा मानना ​​है कि प्रारूप झंडे kAudioFormatFlagIsNonInterleaved निर्दिष्ट करते हैं, यह इस प्रकार है कि किसी भी बफर में किसी फ्रेम का आकार केवल 1 चैनल फ्रेम का आकार हो सकता है। यदि यह सही है mChannelsPerFrame निश्चित रूप से एक भ्रमित नाम है।

मुझे उम्मीद है कि कोई और इसकी पुष्टि/स्पष्टीकरण देगा।

5

mBytesPerFrame का मान mFormatFlags पर निर्भर करता है। CoreAudioTypes.h से:

Typically, when an ASBD is being used, the fields describe the complete layout 
of the sample data in the buffers that are represented by this description - 
where typically those buffers are represented by an AudioBuffer that is 
contained in an AudioBufferList. 

However, when an ASBD has the kAudioFormatFlagIsNonInterleaved flag, the 
AudioBufferList has a different structure and semantic. In this case, the ASBD 
fields will describe the format of ONE of the AudioBuffers that are contained in 
the list, AND each AudioBuffer in the list is determined to have a single (mono) 
channel of audio data. Then, the ASBD's mChannelsPerFrame will indicate the 
total number of AudioBuffers that are contained within the AudioBufferList - 
where each buffer contains one channel. This is used primarily with the 
AudioUnit (and AudioConverter) representation of this list - and won't be found 
in the AudioHardware usage of this structure.