https://www.cnblogs.com/jifeng/p/10674365.html
https://github.com/hutm/JSSRC
将PCM的采样率装换
long pre = System.currentTimeMillis();
String beforeSampleChangedFilePath = "F:\\tmpSave\\audio\\07-15-11-43-50.pcm";
String sampleChangedFilePath = "F:\\tmpSave\\audio\\change.pcm";
File beforeSampleChangedFile = new File(beforeSampleChangedFilePath);
File sampleChangedFile = new File(sampleChangedFilePath);
try {
FileInputStream fileInputStream = new FileInputStream(beforeSampleChangedFile);
FileOutputStream fileOutputStream = new FileOutputStream(sampleChangedFile);
/**
* sfrq:先前的采样率
* dfrq:目标采样率
* bps:1:8bit 2:16 3:24 4:32
* dbps:目标bit
* nch:通道数
*/
new SSRC(fileInputStream, fileOutputStream, 22050, 16000,
2,
2,
4, Integer.MAX_VALUE, 0, 0, true);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("time:" + (System.currentTimeMillis() - pre));