Wav file convert to byte array in java

前端 未结 4 2078
慢半拍i
慢半拍i 2020-12-01 11:49

My project is \'Speech Recognition of Azeri speech\'. I have to write a program that converts wav files to byte array.

How to convert audio file to byt

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 12:14

    Convert file to byte array

    fileToByteArray("C:\..\my.mp3");

    `public static byte[] fileToByteArray(String name){
        Path path = Paths.get(name);
        try {
            return Files.readAllBytes(path);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }`
    

提交回复
热议问题