Je suis en mesure d'obtenir la description audio de AVCaptureDeviceFormat.Comment puis-je obtenir le taux d'échantillonnage et bits par canal sur une CMAudioFormatDescription
let formats = device.formats
for format in formats {
print(format.formatDescription)
}
Mais voudrait obtenir directement à la propriété mSampleRate et mBitsPerChannel.
CMAudioFormatDescription 0x60000010b880 [0x7fffadb29d80] {
mediaType:'soun'
mediaSubType:'lpcm'
mediaSpecific: {
ASBD: {
mSampleRate: 44100.000000
mFormatID: 'lpcm'
mFormatFlags: 0x9
mBytesPerPacket: 8
mFramesPerPacket: 1
mBytesPerFrame: 8
mChannelsPerFrame: 2
mBitsPerChannel: 32 }
cookie: {(null)}
ACL: {Stereo (L R)}
FormatList Array: {(null)}
}
extensions: {(null)}
}
Comment est-ce que je peux y arriver? J'ai regardé dans le AudioFormatGetProperty() dans le cadre AudioToolBox, mais je me perds. Toute l'aide grandement appréciée.
C'est parfait, merci. –
De rien! –