I'm trying to create my own MP3 audio file. How would I go about doing this?
File mySong = new File("generated song.mp3");
FileOutputStream song = new FileOutputStream(mySong);
for (int n = 0; n < 3000; n++){
song.write(n % 256);
}
song.close();
I tried the above code, but Windows gave me an error when I tried playing it back. I imagine there must be some beginning and ending sequence of bytes that I need to write to the file in order for it to be properly decoded. So, how could I generate my own .MP3 file?