×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2004
    Location
    North East England
    Posts
    57

    AMR tp PCM using CMMFCodec on Symbian 8.0 (6630)

    Hi,

    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);
    srcbuf->Data().Copy(amrdata, 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..

    Thanks
    Stew

  2. #2
    Regular Contributor
    Join Date
    Jan 2004
    Location
    North East England
    Posts
    57
    Sorted.

    I was creating a new CMMFCodec for each decode. Obviously (since AMR decoding depends on previously decoded frames) this wouldnt work.

    I just store one at class level now.

  3. #3
    Regular Contributor
    Join Date
    Jun 2005
    Location
    Philippines
    Posts
    163

    Unhappy Re: AMR tp PCM using CMMFCodec on Symbian 8.0 (6630)

    So would creating CMMFCodec instance at the ConstructL of your class would make the conversion work. Is it ok for you to post relevant code here? I am getting EDstNotFilled and EProcessIncomplete errors.

Posting Permissions

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