CASDK 1.31 recording to file and intercepting intermediate data
CASDK 1.31 recording to file and intercepting intermediate data
- Subject: CASDK 1.31 recording to file and intercepting intermediate data
- From: Rustam Muginov <email@hidden>
- Date: Mon, 26 Jul 2004 14:29:45 +0400
Hello all.
I am recording sound into the file using high-level classes CAAudioFile and
CAAudioFileRecorder from the Public Utility framework in the CASDK 1.3.1.
The code snipped is standard taken from the samplecode.
try {
const int kNumberBuffers = 3;
const unsigned kBufferSize = 0x8000;
file = new CAAudioFile();
recorder = new CAAudioFileRecorder(kNumberBuffers, kBufferSize);
CAStreamBasicDescription dataFormat;
dataFormat.mSampleRate = deviceFormat.mSampleRate;
// ........
// skipped setting dataFormat.....
file->PrepareNew(dataFormat, 0.);
file->Create(filename, kAudioFileAIFFType);
recorder->SetFile(file->GetAudioFileID());
recorder->Start();
}
The question is: How could I add some kind of intercepting intermediate
data?
For example: calculate level of the signal and draw some picture for user
feedback. Or, alternatively, multiply each sample to 4.
What would be the most appropriate way?
I could see several ways:
1. Subclass the CAAudioFileRecorder class and examine/modify the samples
inside the CAMySubclassOfAudioFileRecorder::InputProc
2. Subclass the CAAudioFile and override the WritePackets?
WritePacketsFromCallback? Function
3. Install the sound convertor unit into the CAAudioFile class instance and
use this to handle the samples. This is the area which I do not completely
understand, could anyone say if this idea is ok and give same snippets?
4. Any other ways?
Thank you all in advance.
_______________________________________________
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.