AudioKit:通过OS(macOS)更改输出设备时发生错误/崩溃

时间:2018-12-14 09:24:11

标签: swift macos cocoa audiokit

我目前正在尝试将我的应用切换到AudioKit。据我了解AudioKit,在拔出耳机的过程中将输出设备从耳机更改为内置扬声器应该很有魅力。

这是我在可可应用中编写的一些测试例程:

let player = AKPlayer(url: URL(fileURLWithPath: "Some existing music file"))

func applicationDidFinishLaunching(_ aNotification: Notification) {
    do {
        AudioKit.output = player
        try AudioKit.start()
        player?.play()
    } catch {

    }
}

我收到以下错误消息:

  

2018-12-14 10:16:23.947675 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:1118:HAL_HardwarePlugIn_DeviceStop:HAL_HardwarePlugIn_DeviceStart:没有设备   2018-12-14 10:16:23.947740 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALPlugIn.cpp:536:DeviceStopIOProc:HALPlugIn :: StopIOProc:插件例程出错,错误:560947818(!obj )   2018-12-14 10:16:23.977030 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:996:HAL_HardwarePlugIn_DeviceDestroyIOProcID:HAL_HardwarePlugIn_DeviceDestroyIOProcID:无设备   2018-12-14 10:16:23.977091 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALPlugIn.cpp:454:DeviceDestroyIOProcID:HALPlugIn :: DeviceCreateIOProcID:插件例程出错,错误:560947818(!obj )   2018-12-14 10:16:24.595967 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALB_IOThread.cpp:251:_Start:HALB_IOThread :: __ Start:已经有一个线程   2018-12-14 10:16:24.596085 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596203 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596228 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596285 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596327 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596366 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.596380 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.615329 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.615374 + 0100 TestAudioKit [2829:171503] [AudioHAL_Client] HALC_ShellPlugIn.cpp:817:HAL_HardwarePlugIn_ObjectHasProperty:HAL_HardwarePlugIn_ObjectHasProperty:无对象   2018-12-14 10:16:24.622916 + 0100 TestAudioKit [2829:171790] [AudioHAL_Client] HALSystem.cpp:1688:AudioObjectPropertiesChanged:AudioObjectPropertiesChanged:无此类对象   2018-12-14 10:16:24.622962 + 0100 TestAudioKit [2829:171504] [DDAgg] DefaultDeviceAggregate.cpp:58:GetPreferredStereoChannels:从设备70获取首选立体声通道时出错:``谁?''   2018-12-14 10:16:24.623648 + 0100 TestAudioKit [2829:171504] [DDAgg] DefaultDeviceAggregate.cpp:108:GetPreferredChannelLayout:从设备70获取首选频道布局时出错:``谁?''

有什么建议吗?

MacOS 10.14.2

谢谢 克里斯

0 个答案:

没有答案