Browse Source

代码还原

8 years ago
parent
commit
1dd37743a3
1 changed files with 0 additions and 25 deletions
  1. 0 25
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

+ 0 - 25
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -254,29 +254,4 @@ public class CommonUtil {
        return fileUrls;
    }
    /**
     * 将上传的录音转为mp3格式
     * @param sourcePath 文件的相对地址
     */
    public static void changeToMp3(String sourcePath, String targetPath) {
        File source = new File(sourcePath);
        File target = new File(targetPath);
        AudioAttributes audio = new AudioAttributes();
        Encoder encoder = new Encoder();
        audio.setCodec("libmp3lame");
        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setFormat("mp3");
        attrs.setAudioAttributes(audio);
        try {
            encoder.encode(source, target, attrs);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (InputFormatException e) {
            e.printStackTrace();
        } catch (EncoderException e) {
            e.printStackTrace();
        }
    }
}