The DenoiseFeatures struct is the primary interface for computing audio features used for noise removal, speech detection, or training new neural networks. It maintains the necessary state (buffers, Fourier transforms, and pitch detection) to process audio frames.
To use it, initialize a new instance with DenoiseFeatures::new(), feed it audio input using shift_input or shift_and_filter_input, and then call compute_frame_features to extract the feature vector.
use nnnoiseless::features::DenoiseFeatures;
let mut df = DenoiseFeatures::new();
// Assuming 'input_frame' is a &[f32] of length FRAME_SIZE
df.shift_and_filter_input(input_frame);
// compute_frame_features returns true if the input was essentially silent
let is_silent = df.compute_frame_features();
if !is_silent {
let features = df.features();
// Use the extracted features (e.g., for a neural network)
}