草庐IT

AudioObjectRemovePropertyListener

全部标签

ios - 音频硬件.cpp :1200:AudioObjectRemovePropertyListener: AudioObjectRemovePropertyListener: no object with given ID 0

在swift上做一个项目,我试图启动AVPlayer,由于某种原因,它给我一个异常(exception),说AudioHardware.cpp:1200:AudioObjectRemovePropertyListener:AudioObjectRemovePropertyListener:noobjectwithgivenID0.我想问题出在我的URL上。这是我的代码funcinitPlayer(){leturl:NSURL=NSURL(string:"https://purelight1-163000.appspot.com/api/user/v2/media/track/60/sa

objective-c - CoreAudio AudioObjectRemovePropertyListener 在 Swift 中不起作用

我正在快速使用CoreAudio,需要找到用户何时更改系统音量。我可以正确获取音量,甚至可以添加一个属性监听器来查找用户何时更改音量。但是我需要在某个时候停止监听(如果用户更改默认输出设备)但我无法删除属性监听器。我为Playground创建了一个基本测试,并在命令行obj-c项目中进行了相同的测试。该测试在obj-c中运行良好,但在swift中不起作用代码只是添加了监听器然后将其删除,因此在运行代码后更改音量应该不会打印任何内容,但在swift中它会继续打印快速代码:importCoreAudio//firstgetdefaultoutputdevicevaroutputDevice