×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    16

    CPcmToAmrEncoder - posted under 'Tools and SDKs' also

    Hello All,

    I've posted this question under 'Tools and SDKs' also. Apologies for the repetition.

    I'm adapting the Streaming Input Audio example and am converting each completed buffer into AMR using the CPcmToAmrEncoder API.

    The streaming audio example uses PCM16 (I think thats the only format supported - nothing has been changed on that front).

    The destination buffer that I provide for the Encode() function is of the same length as the source buffer (16000) although I'm sure most of it is unused.

    After the function returns, I write the AMR buffer to file, and I've noticed that the contents are different for different inputs - So I'm assuming that the encoder is working.

    However,
    1. Only the first 32 bytes of data in the 16000 byte buffer are non-zero. Consistently. Why is this happening ?
    2. The TInt& aDstLen parameter to the Encode function now has value 32 - can I safely assume that the actual length of AMR data will be returned in this ?
    3. How would I go about creating an AMR file from this data - how do I add the '#AMR' header and other information ?

    Any help/suggestions would be greatly appreciated.

    Thanks in advance
    -seenu

  2. #2
    Registered User
    Join Date
    Oct 2003
    Posts
    5
    Hi,

    I am working on exactly the same topic.
    t seems that one call of the encode() method only produce 1 AMR frame. So you have run the encoding event (and vice versa the decoding event) in a loop by shifting the input buffer in 320 byte steps. I did this and also put the decode() methode in the playL() methode for decoding back from AMR to PCM.
    Result: Strange noise during playback. The original recording was not recognizable. It also stops after sending the first 16000 byte buffer chunk to the media server.
    Anyone out there who managed to get the streaming Input/Output working with AMR codec?

    thanks in advance Hannes

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    1
    You need to add the AMR header to your descriptor:
    _LIT8(KAmrMagicNumber, "#!AMR\n");
    iRecDes->Append(KAmrMagicNumber);

    Best regards,
    Damon

Posting Permissions

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