So, my teacher wants me to code a program that creates WAV files, and I really don't know how I should write all the data in bytes, create a file and give it the .WAV extension by only using the imports java.io.File and java.lang I'm not asking for code to just copy and paste, I just want to know how I am supposed to create all the data (which i think i understand that, in a WAV file is a header followed by a sin-like function), then store it in a File and give it the .wav I have already tried creating a .txt file with
File file = new File(path);
if(file.exists()==false) {
try {
file.createNewFile();
} catch(IOException e) {
}
}
But the file doesn't appear and i don't know how am i supposed to write all the data, like if it should be just one line of hex stuff, or binary, or idk