|
@@ -11,116 +11,50 @@ import javax.sound.sampled.AudioFormat;
|
|
*/
|
|
*/
|
|
public class SoundCompareConfig {
|
|
public class SoundCompareConfig {
|
|
|
|
|
|
- //采样率
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 采样率
|
|
|
|
+ */
|
|
public float simpleRate = 44100;
|
|
public float simpleRate = 44100;
|
|
- //采样大小
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 采样大小
|
|
|
|
+ */
|
|
public int simpleSize = 1024;
|
|
public int simpleSize = 1024;
|
|
- //帧覆盖大小
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 帧覆盖大小
|
|
|
|
+ */
|
|
public int overlap = 256;
|
|
public int overlap = 256;
|
|
|
|
|
|
- //音频解析格式
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 音频解析格式
|
|
|
|
+ */
|
|
public AudioFormat audioFormat = new AudioFormat(simpleRate, 16, 1, true, false);
|
|
public AudioFormat audioFormat = new AudioFormat(simpleRate, 16, 1, true, false);
|
|
- //音频解析算法
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 音频解析算法
|
|
|
|
+ */
|
|
public PitchProcessor.PitchEstimationAlgorithm algo = PitchProcessor.PitchEstimationAlgorithm.FFT_YIN;
|
|
public PitchProcessor.PitchEstimationAlgorithm algo = PitchProcessor.PitchEstimationAlgorithm.FFT_YIN;
|
|
- //分贝检测器
|
|
|
|
- public SilenceDetector silenceDetecor = new SilenceDetector();
|
|
|
|
-
|
|
|
|
- //有效分贝大小
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 分贝检测器
|
|
|
|
+ */
|
|
|
|
+ public SilenceDetector silenceDetector = new SilenceDetector();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @describe 有效分贝大小
|
|
|
|
+ */
|
|
public int validDb = -70;
|
|
public int validDb = -70;
|
|
- //有效频率
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 有效频率
|
|
|
|
+ */
|
|
public int validFrequency = 20;
|
|
public int validFrequency = 20;
|
|
- //音准前后音分误差范围
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 音准前后音分误差范围
|
|
|
|
+ */
|
|
public int intonationCentsRange = 3;
|
|
public int intonationCentsRange = 3;
|
|
- //节奏有效阈值
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 节奏有效阈值
|
|
|
|
+ */
|
|
public float cadenceValidDuty = 0.09f;
|
|
public float cadenceValidDuty = 0.09f;
|
|
- //完整性有效频率误差范围
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @describe 完整性有效频率误差范围
|
|
|
|
+ */
|
|
public int integrityFrequencyRange = 30;
|
|
public int integrityFrequencyRange = 30;
|
|
-
|
|
|
|
- public float getSimpleRate() {
|
|
|
|
- return simpleRate;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setSimpleRate(float simpleRate) {
|
|
|
|
- this.simpleRate = simpleRate;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getSimpleSize() {
|
|
|
|
- return simpleSize;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setSimpleSize(int simpleSize) {
|
|
|
|
- this.simpleSize = simpleSize;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getOverlap() {
|
|
|
|
- return overlap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setOverlap(int overlap) {
|
|
|
|
- this.overlap = overlap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public AudioFormat getAudioFormat() {
|
|
|
|
- return audioFormat;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setAudioFormat(AudioFormat audioFormat) {
|
|
|
|
- this.audioFormat = audioFormat;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public PitchProcessor.PitchEstimationAlgorithm getAlgo() {
|
|
|
|
- return algo;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setAlgo(PitchProcessor.PitchEstimationAlgorithm algo) {
|
|
|
|
- this.algo = algo;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public SilenceDetector getSilenceDetecor() {
|
|
|
|
- return silenceDetecor;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setSilenceDetecor(SilenceDetector silenceDetecor) {
|
|
|
|
- this.silenceDetecor = silenceDetecor;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getValidDb() {
|
|
|
|
- return validDb;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setValidDb(int validDb) {
|
|
|
|
- this.validDb = validDb;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getValidFrequency() {
|
|
|
|
- return validFrequency;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setValidFrequency(int validFrequency) {
|
|
|
|
- this.validFrequency = validFrequency;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getIntonationCentsRange() {
|
|
|
|
- return intonationCentsRange;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setIntonationCentsRange(int intonationCentsRange) {
|
|
|
|
- this.intonationCentsRange = intonationCentsRange;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public float getCadenceValidDuty() {
|
|
|
|
- return cadenceValidDuty;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setCadenceValidDuty(float cadenceValidDuty) {
|
|
|
|
- this.cadenceValidDuty = cadenceValidDuty;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public int getIntegrityFrequencyRange() {
|
|
|
|
- return integrityFrequencyRange;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setIntegrityFrequencyRange(int integrityFrequencyRange) {
|
|
|
|
- this.integrityFrequencyRange = integrityFrequencyRange;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|