Recording in MACE 3:1 and 6:1
Recording in MACE 3:1 and 6:1
- Subject: Recording in MACE 3:1 and 6:1
- From: Tomas Zahradnicky <email@hidden>
- Date: Sat, 26 Apr 2014 23:26:52 +0200
Hello CoreAudio API list members,
I am trying to record an AIFF-C audio file with the MACE 3:1 compression, but weird things happen.
First, I'm wondering how should be an ASBD properly filled for MACE since the docs are all peculiarly quiet on this topic. When I iterate the global file properties, ask for the AIFF-C file format with the MACE 3:1 compression, and extract an ASBD, it is all zero except for ASBD.mFormat=kAudioFormatMACE3. I then set:
ASBD.mSampleRate=44100.0;
ASBD.mChannelsPerFrame=1;
ASBD.mBitsPerChannel=0; /* compressed file format */
ASBD.mFormatFlags=0;
I believe I have to set ASBD.mBytesPerFrame=1=mBitsPerChannel*mChannelsPerFrame/8, but am unsure about ASBD.mBytesPerPacket and ASBD.mFramesPerPacket since this is a compressed format. Should there be 3 frames per packet for MACE 3:1 and 6 for MACE 6:1 or something different? Should I really set mBitsPerChannel to 0 (the docs say so, as the audio is compressed)?
Second, afconvert also behaves oddly. When I let it dump all file formats, AIFF-C/MAC3 is supported,
$ afconvert -hf
Audio file and data formats:
...
'AIFC' = AIFC (.aifc, .aiff, .aif)
data_formats: I8 BEI16 BEI24 BEI32 BEF32 BEF64 UI8 'ulaw'
'alaw' 'MAC3' 'MAC6' 'ima4' 'QDMC' 'QDM2'
'Qclp' 'agsm'
and when I request a WAVE file to be converted into AIFF-C with MACE 3:1, I get an error:
$ afconvert -c 1 -d MAC3 -f AIFC cdquality.wav result.aiff
Error: ExtAudioFileSetProperty ('cfmt') failed ('fmt?')
Am I doing something wrong?
Thank you,
Tomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden