Hi all,
Does anyone know what is the "expected" behaviour of
CMdaAudioRecorderUtility when the buffer passed to it overflows??
I'm using something like
void CMySoundRec::OpenDescL(CDesC8Array* aDescArray)
{
// .... // iBuf goes onto heap...
iBuf = new (ELeave) TBuf<2048>;
// Set the audio settings with TMdaAudioDataSettings object
iSettings.iChannels = 1;
iSettings.iSampleRate = 8000
// Capture the desc. array so that when the local buffer is filled, dump it
into array and restart recording.
iClientBuf = aDescArray;
// iBuf is a small local buffer
iMdaRecorder->OpenL(new TMdaDesClipLocation(*iBuf), new TMdaWavClipFormat(),
new TMdaGsmWavCodec(), &iSettings);
}
to open the 8bit buffer descriptor passed by client.
And the event handler is something like
void CMySoundRec::MoscoStateChangeEvent(CBase* /* aObject */, TInt
aPreviousState, TInt aCurrentState, TInt aErrorCode)
{
// Print the values of prev. state, current state and error code using
RDebug::Print()
if(aErrorCode == KErrOverflow)
{
// Copy the local buffer into the client desc. array.
iClientBuf->AppendL(*iBuf);
iBuf->Zero();
RecordL();
}
}
Now the problem is that everything works fine till the local buffer
overflows. After that, the method MoscoStateChangeEvent() gets called as
expected as the recorder changes states from ERecording (3) to EReady (1)
and I get aErrorCode as KErrOverflow - just as expected.
But when I flush the local buffer and restart recording using RecordL(),
nothing gets recorded, the local buffer always has size 0 - it doesn't get
filled up at all after the first overflow.
What is the problem?
What is it that I'm doing wrong?
Does it mean that I should ALWAYS provide it with a HUGH buffer all the time
- which can never overflow?
If that is the case, how do I decide how big the buffer should be?
Unfortunately, such things (like the expected behaviour of internal classes
like CMdaAudioRecorderUtility under error conditions and the solutions) are
not documented anywhere :dontknow: . I even checked out the book "Symbian OS C++ For
Mobile Phones" in which MMF is discussed in vol. 2. It just discusses
whatever is given in the docs and sample examples - nothing more.
I've posted this question as it is on Symbian DevNet Forums and NewLC forums too.
TIA,