Hello, I am trying to hide string data to a wave file. I am removing (apparently) headers from the wav file using AudioSystem.getAudioInputStream(file).
Then I am (trying to) change the last bits to the string user has entered and then writing the byte array to a new WAV file using AudioSystem.write(AudioInputStream, AudioFileFormat.Type.WAVE, file).
I've checked the first 44 bytes(headers) of both the input and the output files and the input file doesn't seem to have "RIFF" and size of file whether the output file has apparently everything a WAVE header should have.
Still after writing the data using the below mentioned code when I tried to read the hidden data using another code I am getting the same data even if i change the user input (hidden string), that points out that data isn't being written at all.
Thanks in advance whoever has read this much and looking forward to help.
The is.read will not necessarily fill the byte, so it's quite possible you have an incomplete read.
In addition, how do you know that the size of the WAV file is exactly 903271 bytes?
If it isn't then you are either chopping off the end of the WAV, or ending up with a load of 0's at the end of the array, as you then write the entire array out.