如何将.wav文件转换为字节数组? [英] How to convert .wav file into byte array?
本文介绍了如何将.wav文件转换为字节数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的磁盘驱动器中有一个 .wav
文件。我需要使用java将 .wav
文件转换为字节数组
。
任何人都可以帮忙吗? 可以使用 Files.readAllBytes
来实现这一点。
$ b
文件。该方法确保在读取所有字节或引发I / O错误或其他运行时
异常时,文件为
。
I have a .wav
file in my disk drive. I need to convert that .wav
file to byte array
using java.
Can anyone help?
解决方案
You can use Files.readAllBytes
to achieve this.
Read all the bytes from a file. The method ensures that the file is closed when all bytes have been read or an I/O error, or other runtime exception, is thrown.
这篇关于如何将.wav文件转换为字节数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文