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":
[self failWithErrorCode:AS_AUDIO_QUEUE_CREATION_FAILED];// set the software codec too on the queue.UInt32 val = kAudioQueueHardwareCodecPolicy_PreferSoftware;OSStatus ignorableHardWareError = AudioQueueSetProperty(audioQueue, kAudioQueueProperty_HardwareCodecPolicy, &val, sizeOfUInt32);if (ignorableHardWareError){
And Problems solved.return;}
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