Ive been trying to get my AMR->PCM decoding working on Symbian 8.0 (Nokia 6630) using the CMMFCodec class.
Ive tried feeding both AMR mode 0 (frame size 13) and mode 7 (frame size 32) into the ConvertL method, but the output I get is not correct. Im pretty sure my AMR input is ok, since it works fine with CAmrToPcmDecoder in pre Symbian 8.0 builds.
You can make out what it is supposed to be, and it is the right speed, but it is really garbled. I've saved out the converted PCM to a file and viewed it in a sound editor, and each 20ms decoded PCM seems to be some silence, then some sound.
For mode 7 I get about 5ms of silence, then 15ms of sound.
For mode 0 I get about 10ms of silence, then 10ms of sound.
The relevant part of my code is:
m_AmrDecoder = CMMFCodec::NewL(TUid::Uid(0x101FAF67));
// create a buffer for the amr data and copy in the amr data
// frame size is 13 for amr 0, 32 for amr 7
CMMFDescriptorBuffer* srcbuf = CMMFDescriptorBuffer::NewL(amr_frame_size);
// create a buffer for the pcm output
CMMFDescriptorBuffer* dstbuf = CMMFDescriptorBuffer::NewL(320);
// do the conversion from amr -> pcm (16)
TCodecProcessResult result = m_AmrDecoder->ProcessL(*srcbuf, *dstbuf);
// after this i use masoc for output, and also write the pcm
// to a file that I bluetooth to my desktop to try playing
// sounds the same garbled mess on desktop as phone
Ive checked the result, and the encoded / decoded lengths and all is OK.
Anyone have any ideas - Its really beginning to bug me now..