I’m trying to read a WAV file (and in the future also MP3 and Ogg) file as an array of floats in Java, much like libsndfile in C.
I’m looking at the various documentation in the javax.sampled packages, but I can’t find a clear explanation on how to do that; I’d like to avoid recurring to external libraries if possible.
Any suggestion?
found this page:
http://www.jsresources.org/faq_audio.html
see in particular 9.4: How can I reconstruct sample values from a byte array?
It works as expected, by comparing java’s output with c++ (libsndfile) and matlab (wavread).
I’m going to put the code on m github account when I have time