6

Ich brauche Hilfe beim Verständnis der folgenden ASBD. Es ist der Standard-ASBD, der einer neuen Instanz von RemoteIO zugewiesen wurde (ich habe es durch Ausführen von AudioUnitGetProperty(..., kAudioUnitProperty_StreamFormat, ...) auf der Audioeinheit RemoteIO direkt nach dem Zuordnen und Initialisieren erhalten).Understanding Remote I/O AudioStreamBasicDescription (ASBD)

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 

Die Frage ist, sollte mBytesPerFrame nicht 8 sein? Wenn ich 32 Bits (4 Bytes) pro Kanal und 2 Kanäle pro Rahmen habe, sollte nicht jeder Rahmen 8 Bytes lang sein (statt 4)?

Vielen Dank im Voraus.

Antwort

0

Ich glaube, dass, weil die Format-Flags kAudioFormatFlagIsNonInterleaved angeben, folgt, dass die Größe eines Frames in einem Puffer nur die Größe eines 1-Kanal-Frame sein kann. Wenn das korrekt ist mChannelsPerFrame ist sicherlich ein verwirrender Name.

Ich hoffe, dass jemand anderes dies bestätigen/klären wird.

5

Der Wert mBytesPerFrame hängt von mFormatFlags ab. Von 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.