• 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: AAC hardware encoder in ExtAudioFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AAC hardware encoder in ExtAudioFile


  • Subject: Re: AAC hardware encoder in ExtAudioFile
  • From: Rick Cohen <email@hidden>
  • Date: Mon, 04 Apr 2011 15:56:22 -0400

[iPad1, running IOS 4.3]

I am experiencing a similar problem, but only occasionally.

I am writing a file with the format kAudioFormatMPEG4AAC, the buffers
are copied using ExtAudioFileWriteAsync in a render callback.
Sometimes, my attempt to close a file with ExtAudioFileDispose will
fail with error (-50).  The file reference (which is the only
parameter) appears to be good when Dispose is called.

After Dispose fails, I am able to create another file, but when I
attempt to set the ClientDataFormat property, the call fails with
'hwiu'.  And after that, I cannot figure out how to reset the
hardware, in order to eliminate the 'hwiu' error.

Most of the time, the file close succeeds, and I am able to open
subsequent files and encode them.

I am also playing a file at the same time, presumably using the HW decoder.

Could this be a timing issue?

     - Rick


On Sun, Dec 5, 2010 at 12:08 AM, Doug McCoy <email@hidden> wrote:
> I am using ExtAudioFile services to convert PCM data to AAC. But it only
> works on the first attempt.
>
> Client format:
> AudioStreamBasicDescription:  2 ch,  22050 Hz, 'lpcm' (0x0000000C) 16-bit
> little-endian signed integer
>
> Destination format:
> AudioStreamBasicDescription:  2 ch,  22050 Hz, 'aac ' (0x00000000) 0
> bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
>
> Here is a snippet of my code:
>
> XThrowIfError(ExtAudioFileCreateWithURL(fileURL,
>                     kAudioFileM4AType,
>                     &dstFormat,
>                     NULL,
>                     kAudioFileFlags_EraseFile,
>                     &fileID), "ExtAudioFileCreateWithURL failed!");
>
> size = sizeof(*clientFormat);
> errorStatus = ExtAudioFileSetProperty(fileID,
> kExtAudioFileProperty_ClientDataFormat, size, clientFormat);
> OSStatus recordError = ExtAudioFileWrite(fileID, ioByteSize /
> clientFormat->mBytesPerFrame, &bufferList);
> ExtAudioFileDispose(fileID);
>
>
> On the first use of this code, everything succeeds so I know the code works.
> But on subsequent uses i get 'hwiu' returned from ExtAudioFileSetProperty().
> I am pretty sure this means that the AAC hardware encoder is in use, but I
> don't know how to correct this. Is my code not releasing the AAC codec
> somehow? Is this the resposibility of the developer? I figured the
> ExtAudioFileDispose() would release all resources.
>
> What am I missing?
>
>
>
>
>
 _______________________________________________
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

  • Prev by Date: Please Help fix app from not terminating
  • Next by Date: Re: shoutcast stream encoding debug
  • Previous by thread: Please Help fix app from not terminating
  • Next by thread: Re: kExtAudioFileError_AsyncWriteBufferOverflow on iPad
  • Index(es):
    • Date
    • Thread