我是AVAudioEngine的新手。我的任务很简单:我想从麦克风获得声音,改变音高,保存到文件或播放结果。
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: required条件为false: false == isInputConnToConverter
有人能帮忙吗?谢谢。
发布于 2017-11-24 09:06:43
我找到了解决办法:与其将inputNode连接到节点上,不如安装点击,然后在回调块中使用AVAudioPlayerNode来播放缓冲区
发布于 2017-11-30 14:27:02
AVAudioUnitTimePitch(AVAudioUnitTimeEffect)不支持实时音频。您应该保存原始音频数据,并使用另一个引擎与AVAudioUnitTimePitch进行播放。
https://stackoverflow.com/questions/47457438
复制相似问题