First off this is for homework or... project.
I'm having trouble understanding the idea behind how to draw the sound data waves on to a graph in Java for a project. I have to make this assignment entirely from scratch with a UI and everything so basically making a .wav file editor. The main issue I'm having is getting the sound data into the graph to be drawn. Currently I have a randomly generated array of values just being drawn right now.
So far I have a mini-program running and validating the wav file for it to actually be a wav file.
I'm reading it in with a FileInputStream and validating: the RIFF bytes(0-3), FileLength(4-7), WAVE bytes(8-11), then the format chunk format(starting from the end of the RIFF chunk; and positioning the index to the end of it and giving format 0-3, length of format chunk 4-7, then the next 16 bytes for all the specifications of the wave file and storing those in their appropriate named variables.
Once I get to the DATA chunk and its length past that is all my sound data and that is what I'm unsure of how to store each byte for byte of sound data or even translate it to be value that's related to the amplitude of the sound. I thought validating was similar so it would be the same but it doesn't seem to be that way... Either that or I've been complicating something super simple since I've been staring at this for a few days now.
Any help is appreciated thanks.