• 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: kExtAudioFileProperty_AudioFile property invalid on 10.4?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kExtAudioFileProperty_AudioFile property invalid on 10.4?


  • Subject: Re: kExtAudioFileProperty_AudioFile property invalid on 10.4?
  • From: William Stewart <email@hidden>
  • Date: Mon, 7 Apr 2008 14:20:23 -0700

I think you are mis understanding what the cookie is for.

When you are encoding (going from LPCM to a compressed format, say 'aac ') then you set up the encoding converter with a bunch of parameters, vbr, bit rate, etc. Then, as you write the file you *get* the cookie from the converter before you are finished writing the file out.

When you are decoding (going from a compressed format, say 'aac ' to LPCM), you get the cookie from the file and *set* it on the converter you are using to decode.

So, the cookie contains information from an encoding session that the decoder needs in order to decode the stream. It may not have any specific information about encoding settings, etc, as its primary job is to configure a decoder, not an encoder.

In that context, I don't understand why you would set magic cookie data on a converter you are using to encode.

Bill

On Apr 7, 2008, at 1:15 PM, Stephen F. Booth wrote:
Hello all,

I've run into a 10.4 specific problem and I'm not sure where my mistake is. I'm trying to set the magic cookie data on an ExtAudioFile after modifying the underlying AudioConverter (bitrate, vbr, etc). I'm doing this using the following approach:

1) Get the AudioConverter from the ExtAudioFile (kExtAudioFileProperty_AudioConverter)
2) If it exists, set the relevant properties (bitrate, etc)
3) Notify the ExtAudioFile of the changes (kExtAudioFileProperty_ConverterConfig)
3) Get the magic cookie data from the audio converter (kAudioConverterCompressionMagicCookie)
4) If the format has magic cookie data, attempt to set it on the underlying AudioFileID (kExtAudioFileProperty_AudioFile) using kAudioFilePropertyMagicCookieData


On Leopard, this approach works. On Tiger, attempting to get the kExtAudioFileProperty_AudioFile results in kExtAudioFileError_InvalidProperty (-66151).

My code is loosely based on the UseAC-AF example, specifically WriteCookie(). In my case I am using ExtAudioFile, not AudioFile, so I'm not certain if the magic cookie data will be pulled in automatically (the docs don't say one way or another).

So my two questions:
a) Is there a reason why kExtAudioFileProperty_AudioFile fails on Tiger? I couldn't find anything indicating it is 10.5-only.
b) Is my code logically broken- is it even necessary to set the cookie in this way using ExtAudioFile?


Thanks,
Stephen
_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: kExtAudioFileProperty_AudioFile property invalid on 10.4?
      • From: "Stephen F. Booth" <email@hidden>
References: 
 >kExtAudioFileProperty_AudioFile property invalid on 10.4? (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Re: Meta Parameters
  • Next by Date: Re: kExtAudioFileProperty_AudioFile property invalid on 10.4?
  • Previous by thread: kExtAudioFileProperty_AudioFile property invalid on 10.4?
  • Next by thread: Re: kExtAudioFileProperty_AudioFile property invalid on 10.4?
  • Index(es):
    • Date
    • Thread