package com.ym.mec.biz.dal.config;

import be.tarsos.dsp.pitch.PitchProcessor;

import javax.sound.sampled.AudioFormat;

/**
 * @Author Joburgess
 * @Date 2021/8/4 0004
 */
public class SoundCompareConfig {

    /**
     * @describe 采样率
     */
    public float simpleRate = 44100;
    /**
     * @describe 采样大小
     */
    public int simpleSize = 1024;
    /**
     * @describe 帧覆盖大小
     */
    public int overlap = 256;

    /**
     * @describe 音频解析格式
     */
    public AudioFormat audioFormat = new AudioFormat(simpleRate, 16, 1, true, false);
    /**
     * @describe 音频解析算法
     */
    public PitchProcessor.PitchEstimationAlgorithm algo = PitchProcessor.PitchEstimationAlgorithm.FFT_YIN;

    /**
     * @describe 有效分贝大小
     */
    public int validDb = -65;
    /**
     * @describe 有效频率
     */
    public int validFrequency = 20;
    /**
     * @describe 音准前后音分误差范围
     */
    public int intonationCentsRange = 3;
    /**
     * @describe 节奏有效阈值
     */
    public float cadenceValidDuty = 0.09f;
    /**
     * @describe 完整性有效频率误差范围
     */
    public int integrityFrequencyRange = 30;
}
