How to Create the Interface

The AMR payload formatter is implemented as an ECOM plug-in. An application user using the AMR payload formatter has to create an instance of the AMR payload formatter by providing the UID (KAmrFormatterUid = 0X2001AA65). Any other formatter that is implemented as an ECOM plug-in and has the same interface as the AMR payload formatter can also be used by providing the UID of that particular implementation.

The following code shows how to create the interface.

// Create an instance of AMR Payload Formatter by passing KAmrFormatterUid
CStreamFormatter * aStreamFormatter =  CStreamFormatter::NewL(TUid::Uid(KAmrFormatterUid));

After creating the interface the user calls the set or get stream properties. For more information see, How to Set and Get the AMR Stream Property.

The user calls the CStreamFormatter::Pack() and CStreamFormatter::Unpack() function to pack or unpack the AMR encoded data. For more information see, How to Pack and Unpack the AMR Encoded Data.

Then the user has to free the allocated memory as shown in the following code.

delete aStreamFormatter;
// Close the ECOM session
REComSession::FinalClose();