×
Namespaces

Variants
Actions
Revision as of 06:20, 26 July 2012 by hamishwillee (Talk | contribs)

How to convert PCM to AMR

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: User:Kanu123 (30 Jun 2007)
Last edited: hamishwillee (26 Jul 2012)
// Uid of PCM16toAMR codec is 0x101FAF68
CMMFCodec* codec = CMMFCodec::NewL(TUid::Uid(0x101FAF68));
CleanupStack::PushL(codec);
CMMFDescriptorBuffer* srcbuf = CMMFDescriptorBuffer::NewL(320);
CleanupStack::PushL(srcbuf);
// Copy your PCM frame data into srcbuf, for example: srcbuf->Data().Copy(pcmbuf);
CMMFDescriptorBuffer* dstbuf = CMMFDescriptorBuffer::NewL(32);
CleanupStack::PushL(dstbuf);
TCodecProcessResult result = codec->ProcessL(*srcbuf, *dstbuf):
// now the dstbuf contains an AMR frame data
CleanupStack::PopAndDestroy(dstbuf);
CleanupStack::PopAndDestroy(srcbuf);
CleanupStack::PopAndDestroy(codec);
[[Category:]]
53 page views in the last 30 days.
×