Expose dither for JNI (#2215)
This commit is contained in:
@@ -6,10 +6,12 @@ package com.k2fsa.sherpa.onnx;
|
||||
public class FeatureConfig {
|
||||
private final int sampleRate;
|
||||
private final int featureDim;
|
||||
private final float dither;
|
||||
|
||||
private FeatureConfig(Builder builder) {
|
||||
this.sampleRate = builder.sampleRate;
|
||||
this.featureDim = builder.featureDim;
|
||||
this.dither = builder.dither;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
@@ -24,9 +26,14 @@ public class FeatureConfig {
|
||||
return featureDim;
|
||||
}
|
||||
|
||||
public float getDither() {
|
||||
return dither;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private int sampleRate = 16000;
|
||||
private int featureDim = 80;
|
||||
private float dither = 0.0f;
|
||||
|
||||
public FeatureConfig build() {
|
||||
return new FeatureConfig(this);
|
||||
@@ -41,5 +48,9 @@ public class FeatureConfig {
|
||||
this.featureDim = featureDim;
|
||||
return this;
|
||||
}
|
||||
public Builder setDither(float dither) {
|
||||
this.dither = dither;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user