Troubleshooting "AudioQueueObject::IONodeConnection::_AcquireHardwareCodec: failed ('hwiu')" when playing sound file
[Error]: 21:46:56.148 [AudioQueueServer] AudioQ开发者_运维问答ueueObject::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?
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));
精彩评论