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

ConvertFile sample on iPhone 2.2.1 SDK


  • Subject: ConvertFile sample on iPhone 2.2.1 SDK
  • From: Scott Tury <email@hidden>
  • Date: Thu, 19 Mar 2009 12:45:35 -0400

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: William Stewart <email@hidden>
  • Prev by Date: Re: How to use NSTaskDidTerminateNotification on iPhone?
  • Next by Date: Re: Direct Monitoring?
  • Previous by thread: Re: Audio driver - can I hide it?
  • Next by thread: Re: ConvertFile sample on iPhone 2.2.1 SDK
  • Index(es):
    • Date
    • Thread