Troubleshooting “AudioQueueObject::IONodeConnection::_AcquireHardwareCodec: failed ('hwiu')” when playing sound file

半腔热情 提交于 2020-02-24 10:17:46

问题


[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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!