I'm wondering how I may obtain musical information such as amplitude from a audio file?
Suppose we have a raw audio file, what I want to extract data from the file which allows me to generate a curve such as http://www1.icsi.berkeley.edu/Speech/mr/nearfar.html. Once I have obtained this curve, I will perform FFT, etc.
I have been trying to search for solutions in Java Sound, but what I only know so far is that I can pour the data into byte[]
using AudioInputStream
.
But how do I translate that byte[]
into a double[]
which contains actual information about the sound? In this case, the values in the double[]
represent amplitude.
Could anyone please provide a solution to solve this problem in Java?
AudioInputStream
, it skips the header and gives only valid PCM bytes. – Narial