Objective c AVAudioEngine准备过程中出错
我是AVAudioEngine的新手。 我的任务很简单:我想从麦克风中获取声音,改变它的音调并保存到文件中,或者只是播放结果Objective c AVAudioEngine准备过程中出错,objective-c,avaudioengine,Objective C,Avaudioengine,我是AVAudioEngine的新手。 我的任务很简单:我想从麦克风中获取声音,改变它的音调并保存到文件中,或者只是播放结果 self.engine = [[AVAudioEngine alloc] init]; self.pitchNode = [[AVAudioUnitTimePitch alloc] init]; self.recordNode = self.engine.inputNode; [self.engine attachNode:self.pitchNode]; AVAud
self.engine = [[AVAudioEngine alloc] init];
self.pitchNode = [[AVAudioUnitTimePitch alloc] init];
self.recordNode = self.engine.inputNode;
[self.engine attachNode:self.pitchNode];
AVAudioFormat *fmt = [self.recordNode inputFormatForBus:0];
[self.engine connect:self.recordNode to:self.pitchNode format:fmt];
[self.engine connect:self.pitchNode to:self.engine.mainMixerNode fromBus:0 toBus:1 format:fmt];
[self.engine connect:self.engine.mainMixerNode to:self.engine.outputNode format:fmt];
[self.engine prepare]; // at this line i got error message
错误:>avae>AVAudioEngineGraph.mm:685:InitializeActiveNodesInInputChain:所需条件为false:false==isInputConnToConverter
有人能帮忙吗?谢谢。我找到了解决方法:我没有将inputNode连接到pitch节点,而是在其回调块中安装tap并播放带有AVAudioPlayerNode的缓冲区。AVAudioUnitTimePitch(AVAudioUnitTimeEffect)不支持实时音频。您应该保存原始音频数据,并使用另一个带有AVAudioUnitTimePitch的引擎进行播放。您可以在此处发布您使用的工作代码吗?