我想在使用 tarsosDSP 进行音高检测之前过滤传入的音频。我试图在音高检测之前添加一个高通和低通滤波器。但是,即使在 300hz 或 6000Hz 范围之外,音高检测也会输出所有频率。代码有问题吗?
PitchDetectionHandler handler = new PitchDetectionHandler() {
@Override
public void handlePitch(PitchDetectionResult pitchDetectionResult,
AudioEvent audioEvent) {
System.out.println(audioEvent.getTimeStamp() + " " +pitchDetectionResult.getPitch());
}
};
AudioDispatcher dispatcher = AudioDispatcherFactory.fromDefaultMicrophone(44100,2048,0);
dispatcher.addAudioProcessor(new LowPassFS(5000, 44100));
dispatcher.addAudioProcessor(new HighPass(2000, 44100));
//dispatcher.run();
dispatcher.addAudioProcessor(new PitchProcessor(PitchProcessor.PitchEstimationAlgorithm.YIN, 44100, 2048, handler));
new Thread(dispatcher,"Audio Dispatcher").start();