Interface IAudioFeatureExtractor<T>
- Namespace
- AiDotNet.Interfaces
- Assembly
- AiDotNet.dll
Defines the contract for audio feature extraction algorithms.
public interface IAudioFeatureExtractor<T>
Type Parameters
TThe numeric type used for calculations.
Remarks
Audio feature extractors transform raw audio waveforms into meaningful representations that can be used for tasks like speech recognition, music analysis, and audio classification.
For Beginners: Audio files are just sequences of numbers representing sound waves. Feature extractors convert these raw numbers into more useful formats:
- MFCC: Captures how humans perceive different frequencies
- Chroma: Represents musical pitch classes (C, C#, D, etc.)
- Spectral: Measures brightness, contrast, and other spectral properties
Properties
FeatureDimension
Gets the number of features produced per frame.
int FeatureDimension { get; }
Property Value
Name
Gets the name of this feature extractor.
string Name { get; }
Property Value
SampleRate
Gets the sample rate expected by this extractor.
int SampleRate { get; }
Property Value
Methods
Extract(Tensor<T>)
Extracts features from an audio waveform.
Tensor<T> Extract(Tensor<T> audio)
Parameters
audioTensor<T>The audio waveform as a 1D tensor [samples].
Returns
- Tensor<T>
Features as a 2D tensor [frames, features].
Extract(Vector<T>)
Extracts features from an audio waveform.
Matrix<T> Extract(Vector<T> audio)
Parameters
audioVector<T>The audio waveform as a Vector.
Returns
- Matrix<T>
Features as a Matrix [frames x features].
ExtractAsync(Tensor<T>, CancellationToken)
Extracts features from an audio waveform asynchronously.
Task<Tensor<T>> ExtractAsync(Tensor<T> audio, CancellationToken cancellationToken = default)
Parameters
audioTensor<T>The audio waveform.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Tensor<T>>
Features as a 2D tensor [frames, features].