• 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: kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2


  • Subject: Re: kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2
  • From: Doug McCoy <email@hidden>
  • Date: Wed, 26 Jan 2011 22:46:45 -0800

Aha. I had just changed the AudioSession category to be mixable. That disallows hardware codecs. Woops.

Is there a way to do AAC encoding via software and still have the mixable session? How do you force software codec usage?




---
Check out my new iPhone app, FlipTalk. Once featured on the iTunes App Store "What's Hot" list!
http://fliptalkapp.com
http://itunes.com/apps/FlipTalk/
http://tinyurl.com/FlipTalkYoutube





On Wed, Jan 26, 2011 at 9:28 PM, Doug McCoy <email@hidden> wrote:
On the final line of the code below, I am getting the error kAudioQueueErr_InvalidCodecAccess. I know this code worked in previous sdks, though I am not sure which ones exactly.

I am running on an iPod Touch 3G (MC008LL), with iOS 4.2.1.

I am building with SDK 4.2 for deployment target 3.2.


The docs describe this error as "The codec could not be accessed.". Not very helpful IMO. I have seen this code fail when the hardware is in use (error: hwiu), but this is the first ive seen the current error.

Anyone have any insight into what causes this error? Any help you can give is much appreciated.

Thanks,

Doug









        AudioStreamBasicDescription audioFormat;
        memset(&audioFormat, 0, sizeof(audioFormat));
        audioFormat.mSampleRate = 16000.f;    // FS
        audioFormat.mFormatID = kAudioFormatLinearPCM;
        audioFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;// | kAudioFormatFlagIsNonInterleaved;
        audioFormat.mChannelsPerFrame = kAudioNumberOfChannels;           
        audioFormat.mFramesPerPacket = 1;
        audioFormat.mBitsPerChannel = sizeof(short) * 8;            // 16-bit
        audioFormat.mBytesPerFrame = audioFormat.mBitsPerChannel / 8  * audioFormat.mChannelsPerFrame;
        audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame * audioFormat.mFramesPerPacket;
       
       
        AudioStreamBasicDescription clientFormat = audioFormat;
       
        AudioStreamBasicDescription dstFormat;
        memset(&dstFormat, 0, sizeof(dstFormat));
        // compressed format - need to set at least format, sample rate and channel fields for kAudioFormatProperty_FormatInfo
        dstFormat.mSampleRate = audioFormat.mSampleRate; // set sample rate
        dstFormat.mFormatID = kAudioFormatMPEG4AAC;
        dstFormat.mChannelsPerFrame =  audioFormat.mChannelsPerFrame;
       
        // use AudioFormat API to fill out the rest of the description
        UInt32 size = sizeof(dstFormat);
        XThrowIfError(AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, &size, &dstFormat), "couldn't create destination data format");
           
       
        mCachedFileFormat = kAudioFileM4AType;
       
        // create the destination file
        XThrowIfError(ExtAudioFileCreateWithURL((CFURLRef)mScratchAudioFileURL,
                                                mCachedFileFormat,
                                                &dstFormat,
                                                NULL,
                                                kAudioFileFlags_EraseFile,
                                                &mExtRecordingFileID), "ExtAudioFileCreateWithURL failed!");
       
        size = sizeof(clientFormat);
        error = ExtAudioFileSetProperty(mExtRecordingFileID, kExtAudioFileProperty_ClientDataFormat, size, &clientFormat);



---
Check out my new iPhone app, FlipTalk. Once featured on the iTunes App Store "What's Hot" list!
http://fliptalkapp.com
http://itunes.com/apps/FlipTalk/
http://tinyurl.com/FlipTalkYoutube




 _______________________________________________
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

References: 
 >kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2 (From: Doug McCoy <email@hidden>)

  • Prev by Date: kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2
  • Next by Date: AudioQueue run loop newbie question
  • Previous by thread: kAudioQueueErr_InvalidCodecAccess (-66672) when using ExtAudioFile on iOS 4.2
  • Next by thread: AudioQueue run loop newbie question
  • Index(es):
    • Date
    • Thread