MLAudioFeature
class NatML.Features.MLAudioFeature : MLFeature, IMLEdgeFeature, IEnumerable<(MLAudioFeature feature, long timestamp)>
Last updated
Was this helpful?
class NatML.Features.MLAudioFeature : MLFeature, IMLEdgeFeature, IEnumerable<(MLAudioFeature feature, long timestamp)>
Last updated
Was this helpful?
This feature contains raw audio data. Currently, NatML only supports floating-point linear PCM audio data.
The audio feature can be created from several different audio inputs:
The audio feature can be created from an , with the optional ability to specify the duration of the clip to extract.
The audio feature can be created from a sample buffer in managed memory, along with audio format information.
The audio feature can be created from a NativeArray<float>
sample buffer, along with audio format information.
The sampleBuffer
MUST remain valid for the lifetime of the audio feature.
The audio feature can be created from a sample buffer, along with audio format information.
The sampleBuffer
MUST remain valid for the lifetime of the audio feature.
The audio feature can be created from an audio buffer list. This is useful for audio-based predictors that make predictions on longer segments of audio data, like speech-to-text models.
For Edge predictors that make predictions on raw audio waveform data, the audio feature can resample audio data to the specified sampleRate
.
For Edge predictors that make predictions on raw audio waveform data, the audio feature can multiplex or demultiplex audio data to the specified channelCount
.
When making Edge predictions on audio features, some models might require that input data is normalized to some be within some range. The audio feature provides these properties as an easy way to perform any required normalization.
The specified normalization coefficients can then be used like so:
INCOMPLETE.
Refer to the section of the MLFeature
class for more information.
The type
is always an .
The audio feature supports preprocessing when creating an for edge predictions that use raw waveform data:
When using , the normalization coefficients can be specified when creating a predictor:
The audio feature supports specifying a normalization mean when creating an .
The audio feature supports specifying a normalization standard deviation when creating an .