• 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: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned


  • Subject: Re: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned
  • From: William Stewart <email@hidden>
  • Date: Thu, 8 Oct 2009 19:01:10 -0700

For MP4 files you can't open the file for writing. Because you are providing a Proc for writing (MyAudioFile_WriteProc), we think you are opening the file to write to it, and we will not allow that.

So, if you set this proc to NULL, it should be ok.

Bill

On Oct 8, 2009, at 3:11 PM, Michael Glover wrote:

Hello,

We have been using the AudioFileOpenWithCallbacks function to retrieve an AudioFileId for playback data stored in memory using the iPhone SDK (currently using version 3.0, but we've also tried this with 3.1). This has worked well for MP3 track data up to this point. In an effort to switch over to using AAC we have been attempting to use the function to callback to AAC data in an mp4 container (ex: .mp4, .3gp2), but the resulting OSStatus is kAudioFilePermissionsError, which seems like an odd error to return from AFOWC given that data was in fact returned. We have been able to successfully retrieve an AudioFileId when opening MP3 and AAC ADTS files. Perhaps there is some manipulation that needs to be made with the mp4 data, as it has a container wrapping the AAC encoding? We have also tried several type hints (e.g. 0, kAudioFileMPEG4Type, kAudioFileM4AType, kAudioFile3GP2Type) with no success. The behavior is as follows:

1) Make the call to AudioFileOpenWithCallbacks:

OSStatus result = AudioFileOpenWithCallbacks (
self,
MyAudioFile_ReadProc,
MyAudioFile_WriteProc,
MyAudioFile_GetSizeProc,
MyAudioFile_SetSizeProc,
0, // Also tried kAudioFileMPEG4Type, kAudioFileM4AType, kAudioFile3GP2Type
&audioFileID
);


2) The callback MyAudioFile_ReadProc is then made, which returns the requested 8192 bytes:

static OSStatus MyAudioFile_ReadProc (
                             void     *inClientData,
                             SInt64    inPosition,
                             UInt32    requestCount,
                             void     *buffer,
                             UInt32   *actualCount) {
  AudioPlayer *player = (AudioPlayer *) inClientData;
  NSRange bufferRange = NSMakeRange(inPosition, requestCount);
  [player.audioData getBytes: buffer range: bufferRange];
  *actualCount = requestCount;
  return 0;
}

3) Only the one call to MyAudioFile_ReadProc is made. No calls are made to the other callbacks. kAudioFilePermissionsError is returned as the OSStatus.

Any help would be greatly appreciated.

Thanks!
Michael
_______________________________________________
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: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned
      • From: Michael Glover <email@hidden>
References: 
 >Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned (From: Michael Glover <email@hidden>)

  • Prev by Date: Re: Re: Applying a low-pass cutoff inside an AU
  • Next by Date: AVAudioPlayer interferes Output Audiounit on Simulator ?
  • Previous by thread: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned
  • Next by thread: Re: Unable to open certain file formats using AudioFileOpenWithCallbacks, kAudioFilePermissionsError returned
  • Index(es):
    • Date
    • Thread