我正在开发一个简单的桌面应用程序,它可以同时播放和录制音频。一切都很顺利,直到我以某种方式在其中添加了一个错误 - 现在每次我尝试调用AVAudioEngine
'sinputNode
或mainMixer
时,它都会引发错误。
我的标题中有一个属性@property (nonatomic, readonly) AVAudioEngine *engine;
,在我的init
方法实现中,下面的代码在inputNode
调用时抛出:
if (self = [super init]) {
_engine = [[AVAudioEngine alloc] init];
AVAudioInputNode *node = [_engine inputNode];
}
return self;
在所有异常上设置断点会导致调用堆栈的顶部如下所示:
#0 0x00007fff8ba19ab7 in __cxa_throw ()
#1 0x0000000108123779 in AUHAL::GetAudioChannelLayout(unsigned int, unsigned int, AudioChannelLayout*, unsigned char&) ()
#2 0x00000001081183c6 in AUBase::DispatchGetPropertyInfo(unsigned int, unsigned int, unsigned int, unsigned int&, unsigned char&) ()
#3 0x00000001081cdf66 in AUMethodGetPropertyInfo(void*, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned char*) ()
我以前有这个工作,所以我认为我忘记了一些明显的事情?