问题
[Error]: 21:46:56.148 [AudioQueueServer] AudioQueueObject::IONodeConnection::_AcquireHardwareCodec: failed ('hwiu')
That's an error I am getting when playing a sound file. Is this a codec issue or a problem with the sound file itself?
回答1:
From the docs, that error, 'hwiu', means "Hardware in use". The hardware codec is unavailable. If you are creating your own AudioQueue, you can set the hardware codec policy to kAudioQueueHardwareCodecPolicy_PreferSoftware
, which will try the software codec first and fallback on the hardware codec, e.g.:
AudioQueueSetProperty(yourQueue,
kAudioQueueProperty_HardwareCodecPolicy,
&kAudioQueueHardwareCodecPolicy_PreferSoftware,
sizeof(kAudioQueueHardwareCodecPolicy_PreferSoftware));
来源:https://stackoverflow.com/questions/5246707/troubleshooting-audioqueueobjectionodeconnection-acquirehardwarecodec-fail