2017-11-23 22 views
1

私はAVAudioEngineの初心者です。 私の仕事はとてもシンプルです。マイクから音を出したり、音程を変えてファイルに保存したり、結果を再生したいのです。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 

ERROR: >avae> AVAudioEngineGraph.mm:685: InitializeActiveNodesInInputChain: required condition is false: false == isInputConnToConverter

誰も助けることができますか?ありがとう。

答えて

1

私は回避策が見つかりました:代わりにノードをピッチにinputNodeを接続するので、私はちょうどそれをタップをインストールし、それにAVAudioPlayerNodeでバッファを再生するコールバックブロック

0

AVAudioUnitTimePitch(AVAudioUnitTimeEffect)は、リアルタイムオーディオのためのサポートはないです。オリジナルのオーディオデータを保存し、再生するためにAVAudioUnitTimePitchで別のエンジンを使用する必要があります。