音频文件采样率修改

public void reSampleRate(String inputPath,String outputPath,int inputSampleRate,int outputSampleRate){
    File BeforeSampleChangedFile = new File(inputPath);
    File SampleChangedFile = new File(outputPath);
    try {
        FileInputStream fis = new FileInputStream(BeforeSampleChangedFile);
        FileOutputStream fos = new FileOutputStream(SampleChangedFile);
        //一样低采样率转高采样率也是能够的,改下面参数就行。
        new SSRC(fis,fos,inputSampleRate,outputSampleRate,2,2,1,Integer.MAX_VALUE,0,0,true);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

 

 

实用该方法须要如下三个类辅助:https://download.csdn.net/download/yangchanghong1995/10612990html