I am trying to extract amplitude array from an audio file(WAV file). I will be using this amplitude array to plot amplitude vs time graph for the given wav file. I am able to plot the graph myself but does not know how to extract the amplitude from given audio(wav) file in java?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Here is a helper class that you can use. The
getSampleInt()
method is what you need to get the amplitude:It also can play files so that you can test it, but only 8bit, or 16bit files. For other cases you can only read them.
Also, please look at these diagrams to see what WAV files consist of and better understand what this class does.
I tried your code and with a few minor changes it created a result. Whats wrong with the data the code puts out?
I Changed the following lines:
The second thing I changed was:
In your Main method, since you were only printing out the adress of the arary. After those changes the code put out an array that had values, that seemed to correlate with the desired data.
what excatly are you missing, or what do you expect of the data? Could you please clarify the question a bit more?