转换音频文件在将表单mp3转换为wave时会产生噪音

时间:2017-10-13 13:08:20

标签: java audio

以下是我使用jave 1.0.2 jar将mp3文件转换为wave的代码

 File source = new File("D://Test1.mp3");
                                    File target = new File("F://Test.wav");
                                    AudioAttributes audio = new AudioAttributes();
                                    audio.setCodec("pcm_s32be");
                                    audio.setChannels(1);
                                    audio.setSamplingRate(8000);
                                    EncodingAttributes attrs = new EncodingAttributes();
                                    attrs.setFormat("wav"); 

                                    attrs.setAudioAttributes(audio);
                                    Encoder encoder = new Encoder();
                                    encoder.encode(source, target, attrs);

0 个答案:

没有答案