Modifying afrecord sample file
Modifying afrecord sample file
- Subject: Modifying afrecord sample file
- From: Bruno Blondeau <email@hidden>
- Date: Thu, 13 May 2004 23:50:51 +0200
I'm trying to modify the afrecord.cpp sample file so as to use AAC
encoding instead of the PCM/AIFF one.
Could anyone explain me what to change?
const int kNumberBuffers = 3;
const unsigned kBufferSize = 0x8000;
CAAudioFile file;
CAAudioFileRecorder recorder(kNumberBuffers, kBufferSize);
CAStreamBasicDescription dataFormat;
dataFormat.mSampleRate = 44100.; // later get this from the hardware
dataFormat.mFormatID = kAudioFormatLinearPCM;
dataFormat.mFormatFlags = kAudioFormatFlagIsBigEndian |
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
dataFormat.mFramesPerPacket = 1;
dataFormat.mChannelsPerFrame = 2;
dataFormat.mBitsPerChannel = 16;
dataFormat.mBytesPerPacket = dataFormat.mBytesPerFrame = 4;
file.PrepareNew(dataFormat, 0.);
file.Create(recordFileName, kAudioFileAIFFType);
recorder.SetFile(file.GetAudioFileID());
Record(recorder);
Also, I've heard MP3 encoding isn't available. Is this still true?
What about QuickTime encoders? (Qualcomm, QDesign...)
Would it be possible to modify afrecord to use them and generate a
quicktime readable file? (there doesn't seem to be a kAudioFile******
for these formats)
--
Bruno
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.