am using the following code to record amr in 6630
((
iSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;
iSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate8000Hz;

iInput = CMdaAudioInputStream::NewL(*this);
iInput->Open(&iSettings);
iInput->SetDataTypeL(KMMFFourCCCodeAMR);

iOutput = CMdaAudioOutputStream::NewL(*this);
iOutput->Open(&iSettings);
iOutput->SetDataTypeL(KMMFFourCCCodeAMR);

TDes8* buffer;

for (TInt i=0;i<150;i++) // number of buffers in the iBuffer and iEncBuffer is 150
{
buffer = new(ELeave) TBuf8<KBufferSize>; //KBufferSize = 320
buffer->SetMax();
CleanupStack::PushL(buffer);
User::LeaveIfError(iBuffer.Append(buffer));
User::LeaveIfError(iEncBuffer.Append(buffer));
CleanupStack::Pop(buffer);

}
))

now its working fine without the line
iInput->SetDataTypeL(KMMFFourCCCodeAMR);
but in my case i need to record in amr format and when i use the SetDataTypeL() mthod line i get bad audio quality
whats the wrong with this code?
and whats the suitable sittings that should be implemented?

thanx