• 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: ConvertFile sample on iPhone 2.2.1 SDK
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ConvertFile sample on iPhone 2.2.1 SDK


  • Subject: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • From: Doug Wyatt <email@hidden>
  • Date: Thu, 19 Mar 2009 13:12:57 -0700

'perm' is returned when you try to use a hardware codec.

On Mar 19, 2009, at 12:59 , William Stewart wrote:

I think you mean:
kAudioFilePermissionsError (prm?) (we don't have a "perm" error)

If so, this error is only returned from what I can see when you try to write to a file and you are unable too because you don't have sufficient permissions to do so.

Bill

On Mar 19, 2009, at 9:45 AM, Scott Tury wrote:

I am thinking about shipping an iPhone (2.1+ OS) app, with compressed audio delivered with the application. I'd like to convert those compressed audio files to native CAF lossless files on the iPhone when the user launches the application the first time (or when needed). This seems fairly straightforward after I looked at the Apple Mac Os X 10.5 sample code located at: /Developer/ Examples/CoreAudio/SimpleSDK/ConvertFile/

Specifically the file UseExtAF.cpp looks almost exactly what I need in order to make the conversion possible. I built the sample app on Mac OS X, and ran it with one of my files (m4a), and it converted the file into a CAF file that was not compressed. (Excellent!)

I've converted the routines I needed into Objective-C, and tried using the same technique, but I'm getting a permissions ('perm') error when I run through the ConvertFile function. The permissions error is happening on the line:

err = ExtAudioFileSetProperty(infile, kExtAudioFileProperty_ClientDataFormat, size, &clientFormat);

It appears that the ExtAudioFileSetProperty function is unhappy with me trying to set the clientDataFormat for the input file. But if I comment out this line of code, I am unable to get all of the sample frames from the input file - which is what I need in order to convert the compressed file into an uncompressed format.

Is there a way I can work around this error? Or do I need to do this the more involved way, as shown in the UseAC-AF.cpp file in the ConvertFile sample for Mac OS X? I'll convert those methods if need be, but the ExtAudioFile API's look like they should do what I want.

Thank you for your help!

Scott Tury

P.S. I can send the ConvertFile() function if anyone is interested, but it's extremely similar to the Mac OS sample.

_______________________________________________
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: ConvertFile sample on iPhone 2.2.1 SDK
      • From: Scott Tury <email@hidden>
References: 
 >ConvertFile sample on iPhone 2.2.1 SDK (From: Scott Tury <email@hidden>)
 >Re: ConvertFile sample on iPhone 2.2.1 SDK (From: William Stewart <email@hidden>)

  • Prev by Date: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • Next by Date: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • Previous by thread: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • Next by thread: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • Index(es):
    • Date
    • Thread