gpt4 book ai didi

signal-processing - 了解远程 I/O AudioStreamBasicDescription (ASBD)

转载 作者:行者123 更新时间:2023-12-04 15:13:57 26 4
gpt4 key购买 nike

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

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 ?如果每个 channel 有 32 位(4 字节),每帧有 2 个 channel ,那么每帧不应该是 8 字节长(而不是 4 字节)吗?

提前致谢。

最佳答案

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.

关于signal-processing - 了解远程 I/O AudioStreamBasicDescription (ASBD),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12252791/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com