【问题标题】:Understanding Remote I/O AudioStreamBasicDescription (ASBD)了解远程 I/O AudioStreamBasicDescription (ASBD)
【发布时间】:2012-08-28 11:34:02
【问题描述】:

我需要帮助来理解以下 ASBD。它是分配给 RemoteIO 新实例的默认 ASBD(我是在分配和初始化它之后,在 RemoteIO 音频单元上执行 AudioUnitGetProperty(..., kAudioUnitProperty_StreamFormat, ...) 得到的)。

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

问题是,mBytesPerFrame 不应该是8 吗?如果我每个通道有 32 位(4 个字节),每帧有 2 个通道,那么每个帧不应该是 8 个字节长(而不是 4 个)吗?

提前致谢。

【问题讨论】:

    标签: signal-processing core-audio audio-streaming audio-recording audiounit


    【解决方案1】:

    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.
    

    【讨论】:

      【解决方案2】:

      我相信由于格式标志指定kAudioFormatFlagIsNonInterleaved,因此任何缓冲区中的帧大小只能是1通道帧的大小。如果这是正确的,mChannelsPerFrame 肯定是一个令人困惑的名称。

      我希望其他人能确认/澄清这一点。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-24
        • 2015-04-22
        • 1970-01-01
        相关资源
        最近更新 更多