My project is 'Speech Recognition of Azeri speech'. I have to write a program that converts wav files to byte array.
wav
How to convert audio file to byte[]?
Basically as described by the snippet in the first answer, but instead of the BufferedInputStream use AudioSystem.getAudioInputStream(File) to get the InputStream.
BufferedInputStream
AudioSystem.getAudioInputStream(File)
InputStream
Using the audio stream as obtained from AudioSystem will ensure that the headers are stripped, and the input file decode to a byte[] that represents the actual sound frames/samples - which can then be used for FFT etc.
AudioSystem
1.4m articles
1.4m replys
5 comments
56.9k users