2012年7月31日星期二

Audio queue starts failed err: hwiu 1752656245

    In my project, I use a AVPlayer to play local music and iPod Library music together with a AudioStreamer from Matt Gallagher (GitHub here).
        When running this app in iPhone 4s with iOS 5.1.1, it's all fine. While running in a 3GS with iOS 4.1, a failure comes "Audio queue starts failed err: hwiu 1752656245". I search the problem in Google, and find a note write by MATT CONEYBEARE (page here).
    It's because my AVPlayer is using the hardware so AudioStreamer fails.

    So, put the code after code following comment "// get the packet size if it is available":
// set the software codec too on the queue.
    UInt32 val = kAudioQueueHardwareCodecPolicy_PreferSoftware;
    OSStatus ignorableHardWareError = AudioQueueSetProperty(audioQueue, kAudioQueueProperty_HardwareCodecPolicy, &val, sizeOfUInt32);
    if (ignorableHardWareError)
    {
                  [self failWithErrorCode:AS_AUDIO_QUEUE_CREATION_FAILED]; 
        return;
    }
   And Problems solved.

   Thanks for Both Matt's work!


------
My new business with my wife, wholesale meddle-to-high end men's seamless underwear in the Netherlands: https://ecosharelife.com

1 条评论: