欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

安卓系统降低音频采样频率代码

最编程 2024-06-30 09:29:33
...

private void simpleDownSample() {
        File BeforeDownSampleFile = new File(RawRecordFilePath);
        File DownSampled = new File(DownSampledFilePath);
        try {
            FileInputStream fileInputStream = new FileInputStream(BeforeDownSampleFile);
            FileOutputStream fileOutputStream = new FileOutputStream(DownSampled);
            new SSRC(fileInputStream, fileOutputStream, 44100, 8000,
                    2,
                    2,
                    1, Integer.MAX_VALUE, 0, 0, true);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }