【发布时间】:2014-09-27 03:20:55
【问题描述】:
为了主动降噪,如何使用 Novocaine 生成反相信号?也就是说,在一个NovocaineOutputBlock内,如何生成与输入相位相差180度的输出?
到目前为止,这是我的代码:
__weak AppDelegate * wself = self;
self.ringBuffer = new RingBuffer(32768, 2);
self.audioManager = [Novocaine audioManager];
[self.audioManager setInputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels)
{
wself.ringBuffer->AddNewInterleavedFloatData(data, numFrames, numChannels);
}];
[self.audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels)
{
wself.ringBuffer->FetchInterleavedData(data, numFrames, numChannels);
for (int i=0; i < numFrames; ++i)
{
for (int iChannel = 0; iChannel < numChannels; ++iChannel)
{
// Within here do noise cancellation. How?
}
}
}];
【问题讨论】:
-
@omygaudio 有什么想法吗?
标签: ios macos core-audio novocaine