I'm reading in 16 bit WAV files in Java (apparently always little-endian). I need to check the amplitude at the beginning and end of a WAV file. I'm hoping for silence at the start and end of clips but need to report on a scale if not. The files are always accessible locally. I've read about converting the file to a byte array and that converting each byte to a signed integer representation of the hex gives the amplitude but (if this is the case) I'm confused about how to apply this to audio that would need to be split across 2 bytes per sample. I've also read about bit-shifting but I'm unsure if it's relevant if I use a byte array.
To clarify, I'd rather not use unnecessary imports if possible but could and I don't have to use bytes to divide up the WAV, I only need a reliable way to present the amplitude at particular points in the array (start and end).