Ios Xcode音频播放器突然停止工作?
我的应用程序播放Spotify的歌曲预览。在干扰了我的设备声音设置以连接蓝牙耳机后,我的xcode应用程序突然开始给我一个播放歌曲时出现的错误列表。我知道这一定是因为设置问题,因为当我的队友运行应用程序时,它可以播放歌曲。以下是我得到的错误:Ios Xcode音频播放器突然停止工作?,ios,swift,xcode,avaudioplayer,Ios,Swift,Xcode,Avaudioplayer,我的应用程序播放Spotify的歌曲预览。在干扰了我的设备声音设置以连接蓝牙耳机后,我的xcode应用程序突然开始给我一个播放歌曲时出现的错误列表。我知道这一定是因为设置问题,因为当我的队友运行应用程序时,它可以播放歌曲。以下是我得到的错误: 2020-04-19 14:42:54.178671-0700 bauxloginpage[78388:7265197] HALDefaultDevice::Initialize: couldn't add the default input devic
2020-04-19 14:42:54.178671-0700 bauxloginpage[78388:7265197] HALDefaultDevice::Initialize: couldn't add the default input device listener, Error: 1102 ()
2020-04-19 14:42:54.180684-0700 bauxloginpage[78388:7265197] HALDefaultDevice::Initialize: couldn't add the default output device listener, Error: 1102 ()
2020-04-19 14:42:54.181832-0700 bauxloginpage[78388:7265197] HALDefaultDevice::Initialize: couldn't add the default system output device listener, Error: 1102 ()
2020-04-19 14:42:54.183826-0700 bauxloginpage[78388:7265197] HALDefaultDevice::Initialize: couldn't add the default shared output device listener, Error: 1102 ()
2020-04-19 14:42:54.188086-0700 bauxloginpage[78388:7265197] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000398c720> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-04-19 14:42:54.190253-0700 bauxloginpage[78388:7265197] AudioObjectSetPropertyData: no object with given ID 0
2020-04-19 14:42:54.190642-0700 bauxloginpage[78388:7265197] AudioSessionSimulatorClientManager.cpp:83:SimulatorUpdateHALForPrimaySession_Priv: Failed to set processVolumeScalar on device. Error: 560947818
2020-04-19 14:42:54.902449-0700 bauxloginpage[78388:7268376] HALCADClient::GetPropertyData: unknown property
2020-04-19 14:42:54.902598-0700 bauxloginpage[78388:7268376] [ddagg] AggregateDevice.mm:776 couldn't get default input device, ID = 0, err = 0!
2020-04-19 14:42:54.902983-0700 bauxloginpage[78388:7268376] HALCADClient::GetPropertyData: unknown property
2020-04-19 14:42:54.903132-0700 bauxloginpage[78388:7268376] [ddagg] AggregateDevice.mm:776 couldn't get default output device, ID = 0, err = 0!
2020-04-19 14:42:54.903415-0700 bauxloginpage[78388:7268376] AudioDeviceStop: no device with given ID
2020-04-19 14:42:54.903646-0700 bauxloginpage[78388:7268376] [aqme] AQMEIO.cpp:320:_FindIOUnit: error -66680 finding/initializing AQDefaultDevice
2020-04-19 14:42:54.903813-0700 bauxloginpage[78388:7268376] CA_UISoundClient.cpp:110:CA_UISoundClientBase: * * * NULL AQIONode object
2020-04-19 14:42:54.903850-0700 bauxloginpage[78388:7265197] AudioDeviceStop: no device with given ID
2020-04-19 14:42:54.903973-0700 bauxloginpage[78388:7265197] [aqme] AQMEIO.cpp:320:_FindIOUnit: error -66680 finding/initializing AQDefaultDevice
2020-04-19 14:42:54.904010-0700 bauxloginpage[78388:7268376] CA_UISoundClient.cpp:772:UISoundNewRenderer: Can't make UISound Renderer
2020-04-19 14:42:54.904105-0700 bauxloginpage[78388:7265197] [AQ] AudioQueueObject.cpp:1765:Prime: failed (-66680); will stop (11025/0 frames)
2020-04-19 14:42:54.904904-0700 bauxloginpage[78388:7265197] AudioDeviceStop: no device with given ID
2020-04-19 14:42:54.905060-0700 bauxloginpage[78388:7265197] [aqme] AQMEIO.cpp:320:_FindIOUnit: error -66680 finding/initializing AQDefaultDevice
2020-04-19 14:42:54.916099-0700 bauxloginpage[78388:7265197] [AQ] AudioQueueObject.cpp:1765:Prime: failed (-66680); will stop (11025/0 frames)
2020-04-19 14:42:57.367873-0700 bauxloginpage[78388:7264028] AudioDeviceStop: no device with given ID
2020-04-19 14:42:57.368232-0700 bauxloginpage[78388:7264028] [aqme] AQMEIO.cpp:320:_FindIOUnit: error -66680 finding/initializing AQDefaultDevice
2020-04-19 14:42:57.368428-0700 bauxloginpage[78388:7264028] [AQ] AudioQueueObject.cpp:1765:Prime: failed (-66680); will stop (11025/0 frames)
2020-04-19 14:42:58.357297-0700 bauxloginpage[78388:7264028] AudioDeviceStop: no device with given ID
2020-04-19 14:42:58.357749-0700 bauxloginpage[78388:7264028] [aqme] AQMEIO.cpp:320:_FindIOUnit: error -66680 finding/initializing AQDefaultDevice
2020-04-19 14:42:58.358055-0700 bauxloginpage[78388:7264028] [AQ] AudioQueueObject.cpp:1765:Prime: failed (-66680); will stop (11025/0 frames)
2020-04-19 14:42:54.178671-0700 bauxloginpage[78388:7265197]HALDefaultDevice::Initialize:无法添加默认输入设备侦听器,错误:1102()
2020-04-19 14:42:54.180684-0700 bauxloginpage[78388:7265197]HALDefaultDevice::Initialize:无法添加默认输出设备侦听器,错误:1102()
2020-04-19 14:42:54.181832-0700 bauxloginpage[78388:7265197]HALDefaultDevice::Initialize:无法添加默认系统输出设备侦听器,错误:1102()
2020-04-19 14:42:54.183826-0700 bauxloginpage[78388:7265197]HALDefaultDevice::Initialize:无法添加默认的共享输出设备侦听器,错误:1102()
2020-04-19 14:42:54.188086-0700 bauxloginpage[78388:7265197][plugin]工厂附加说明:没有工厂注册id为F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-04-19 14:42:54.190253-0700 bauxloginpage[78388:7265197]AudioObjectSetPropertyData:没有具有给定ID 0的对象
2020-04-19 14:42:54.190642-0700 bauxloginpage[78388:7265197]AudioSessionSimulatorClientManager.cpp:83:模拟器更新AlforpRimaySession_Priv:无法在设备上设置processVolumeScalar。错误:560947818
2020-04-19 14:42:54.902449-0700 bauxloginpage[78388:7268376]HALCADClient::GetPropertyData:未知属性
2020-04-19 14:42:54.902598-0700 bauxloginpage[78388:7268376][ddagg]AggregateDevice.mm:776无法获取默认输入设备,ID=0,错误=0!
2020-04-19 14:42:54.902983-0700 bauxloginpage[78388:7268376]HALCADClient::GetPropertyData:未知属性
2020-04-19 14:42:54.903132-0700 bauxloginpage[78388:7268376][ddagg]AggregateDevice.mm:776无法获取默认输出设备,ID=0,错误=0!
2020-04-19 14:42:54.903415-0700 bauxloginpage[78388:7268376]AudioDevicesStop:没有具有给定ID的设备
2020-04-19 14:42:54.903646-0700 bauxloginpage[78388:7268376][aqme]AQMEIO.cpp:320:_FindIOUnit:错误-66680查找/初始化AQDefaultDevice
2020-04-19 14:42:54.903813-0700 bauxloginpage[78388:7268376]CA_UISoundClient.cpp:110:CA_UISoundClientBase:**空AQIONode对象
2020-04-19 14:42:54.903850-0700 bauxloginpage[78388:7265197]AudioDevicesStop:没有具有给定ID的设备
2020-04-19 14:42:54.903973-0700 bauxloginpage[78388:7265197][aqme]AQMEIO.cpp:320:_FindIOUnit:错误-66680查找/初始化AQDefaultDevice
2020-04-19 14:42:54.904010-0700 bauxloginpage[78388:7268376]CA_UISoundClient.cpp:772:UISoundNewRenderer:无法生成UISound渲染器
2020-04-19 14:42:54.904105-0700 bauxloginpage[78388:7265197][AQ]AudioQueueObject.cpp:1765:Prime:failed(-66680);将停止(11025/0帧)
2020-04-19 14:42:54.904904-0700 bauxloginpage[78388:7265197]AudioDeviceStop:没有具有给定ID的设备
2020-04-19 14:42:54.905060-0700 bauxloginpage[78388:7265197][aqme]AQMEIO.cpp:320:_FindIOUnit:错误-66680查找/初始化AQDefaultDevice
2020-04-19 14:42:54.916099-0700 bauxloginpage[78388:7265197][AQ]AudioQueueObject.cpp:1765:Prime:failed(-66680);将停止(11025/0帧)
2020-04-19 14:42:57.367873-0700 bauxloginpage[78388:7264028]AudioDevicesStop:没有具有给定ID的设备
2020-04-19 14:42:57.368232-0700 bauxloginpage[78388:7264028][aqme]AQMEIO.cpp:320:_FindIOUnit:error-66680查找/初始化AQDefaultDevice
2020-04-19 14:42:57.368428-0700 bauxloginpage[78388:7264028][AQ]AudioQueueObject.cpp:1765:Prime:failed(-66680);将停止(11025/0帧)
2020-04-19 14:42:58.357297-0700 bauxloginpage[78388:7264028]AudioDeviceStop:没有具有给定ID的设备
2020-04-19 14:42:58.357749-0700 bauxloginpage[78388:7264028][aqme]AQMEIO.cpp:320:_FindIOUnit:错误-66680查找/初始化AQDefaultDevice
2020-04-19 14:42:58.358055-0700 bauxloginpage[78388:7264028][AQ]AudioQueueObject.cpp:1765:Prime:failed(-66680);将停止(11025/0帧)
您可以:
清理Xcode生成文件夹(cmd-shift-k)
重新启动Xcode。(退出应用程序)
在不同的设备上尝试你的应用程序。例如您的手机或其他模拟设备
如果问题仍然存在,请说明升级到XCode 12.2(Big-Sur)后我遇到了此问题。
代码行是:
OSStatus status = AudioQueueSetProperty(audioQueue, kAudioQueueProperty_CurrentDevice, &deviceUID, sizeof(audioDeviceUID));
err = AudioQueueStart(audioQueue, NULL);
错误是:
[AQ] AudioQueueObject.cpp:1904:Prime: failed (-66680); will stop (66150/0 frames)
在我的音效、输出和输入设置中,我可以选择通过内置扬声器或桌面流式音频设备在设备模拟器中播放,转到“硬件”选项卡并删除所有内容和设置,解决了此问题。如果您在iOS14模拟器中从Xcode11beta3(或以下版本)测试此功能那么您可能遇到了这样一个bug“AVPlayer无法使用iOS 14 beta版”: