NatML
Search…
MLAudioType
class NatSuite.ML.Types.MLAudioType : MLArrayType
This feature type describes audio buffers.

Creating the Type

1
/// <summary>
2
/// Create an audio feature type.
3
/// <summary>
4
/// <param name="sampleRate">Sample rate</param>
5
/// <param name="channelCount">Channel count</param>
6
/// <param name="sampleCount">Total sample count.</param>
7
MLAudioType (int sampleRate, int channelCount, int sampleCount);
Copied!
The audio type can be created with a sample rate, channel count, and total sample count. There is a corresponding constructor that accepts the feature name for named features:
1
/// <summary>
2
/// Create an ML audio feature type.
3
/// <summary>
4
/// <param name="name">Feature name.</param>
5
/// <param name="sampleRate">Sample rate.</param>
6
/// <param name="channelCount">Channel count.</param>
7
/// <param name="sampleCount">Total sample count.</param>
8
MLAudioType (string name, int sampleRate, int channelCount, int sampleCount);
Copied!

Inspecting the Type

1
/// <summary>
2
/// Feature name.
3
/// </summary>
4
string name { get; }
5
6
/// <summary>
7
/// Feature data type.
8
/// This will typically be a numeric type.
9
/// </summary>
10
Type dataType { get; }
Copied!
Refer to the MLArrayType class for more information.

Inspecting the Format

1
/// <summary>
2
/// Audio sample rate.
3
/// </summary>
4
int sampleRate { get; }
5
6
/// <summary>
7
/// Audio channel count.
8
/// </summary>
9
int channelCount { get; }
Copied!
The audio type provides the audio format which it was created with.
Last modified 2mo ago