×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    How to covert AMR data to PCM?

    Hi all,

    There are many post regarding AMR to PCM or vice-versa. I tried a lot to convert AMR to PCM. It would be really helpful if someone give code snippet for converting AMR to PCM and then playing the PCM.

    Regards,
    Shagor

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224
    The following method is for converting the AMR to PCM16. Remember to take off the 6-Bytes header from the begining of AMR file then pass the data to this method.

    void CStreamPlayEngine::ConvertAmr2PcmL(const TDesC8& aAmrData,TDes8& aDestBuffer)
    {
    iAmrBuffer->Data().Copy(aAmrData);

    TBool OkMai(EFalse);

    TCodecProcessResult result = iOCodec->ProcessL(*iAmrBuffer,*iPcm16Buffer);

    if((result.iStatus == TCodecProcessResult::EProcessComplete))
    {
    OkMai = ETrue;
    aDestBuffer.Copy(iPcm16Buffer->Data());
    }
    else
    {
    //Error processing
    }
    }

    Cheers,
    shagor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×