• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Decoding raw AMR
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Decoding raw AMR


  • Subject: Re: Decoding raw AMR
  • From: Martin Storsjö <email@hidden>
  • Date: Wed, 31 Jan 2007 18:31:16 +0200 (EET)

On Tue, 30 Jan 2007, James McCartney wrote:

On Jan 30, 2007, at 9:46 AM, Martin Storsjö wrote:

On Mon, 29 Jan 2007, James McCartney wrote:

> The AMR codec requires a magic cookie in order to decode. If you don't > set the magic cookie on the AudioConverter, then the AudioCodec will > return kAudioCodecStateError.
> A magic cookie is a string of bytes in some opaque codec-dependant format > which are used to configure the decoder.


Is there any documentation anywhere about what the magic cookie for the AMR decoder should be? I've tried almost all imaginable combinations of the actual file header and the first byte of the packet (containing size information about the packet) or even the whole packet, without success.

// Martin

I believe it is the 17 byte structure defined here:

3GPP2 File Formats for Multimedia Services

8.4.2.2 AMRSpecificBox field for AMRSampleEntry Box

where 'damr' is replaced by 'samr'

http://www.3gpp2.org/public_html/specs/C.S0050-0_v1.0_121503.pdf

Thank you very much!

Using this information I managed to make it work exactly in the way I wanted, using AudioConverter.

The testing of this was very much delayed by lots of strange segmentation faults when setting the magic cookie (when AudioCodecInitialize was called on the AudioCodec component). The current solution seems to be to allocate a larger buffer for the cookie and set the rest of the buffer to zero. Is the AudioCodecInitialize method in the AMR codec perhaps reading outside of what the size parameter says?

// Martin
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Decoding raw AMR (From: Martin Storsjö <email@hidden>)
 >Re: Decoding raw AMR (From: William Stewart <email@hidden>)
 >Re: Decoding raw AMR (From: Martin Storsjö <email@hidden>)
 >Re: Decoding raw AMR (From: William Stewart <email@hidden>)
 >Re: Decoding raw AMR (From: Martin Storsjö <email@hidden>)
 >Re: Decoding raw AMR (From: James McCartney <email@hidden>)
 >Re: Decoding raw AMR (From: Martin Storsjö <email@hidden>)
 >Re: Decoding raw AMR (From: James McCartney <email@hidden>)

  • Prev by Date: Re: Decoding raw AMR
  • Next by Date: Re: AudioUnitSetProperty() returns -10879
  • Previous by thread: Re: Decoding raw AMR
  • Next by thread: Re: Decoding raw AMR
  • Index(es):
    • Date
    • Thread