I'm creating a small audio player in Java and can play certain formats fine (such as WAV). I've discovered that this is because javax.sound
does not support MP4. From what I've read though, converting from MP4 to WAV is lossless so I believe that this shouldn't be that difficult. I know there are plenty of 3rd party libraries out there that can do this, but I'm not interested in downloaded one for something that should be fairly straightforward. I've looked into the specific ISO's for each to try to understand how the data is stored to be able to just create a BufferedReader
and BufferedWritter
to see if I could manually convert it, but I was unable to find the information I was looking for. What would be a way to go about doing this in pure Java 1.7.0 (I know JavaFX has a MediaPlayer, but unfortunately I cannot use 1.8.0).
Or if anyone knows where I can find specific container information for each (such as the header size/information, data, ACK/NACK, etc.) that compose both MP4 and WAV.
There is nothing straight forward about MP4 to wav. Fist off, MP4 is a container not a codec. So your MP4 may contain wav, mp3, aac, AC3, DD+, etc. And all of these formats will required a different decoder to 'convert' to raw PCM.