I am trying to validate the media files like .avi, .wav, .mpeg as valid before the customer uploads. I looked at the sound API and JMF and googled but could not find any suitable answers. Is there any way / packages/ 3rd party software to validate the media files in java ? I looked at the reading the header information for each type as one of the techniques? Any suggestions.
I read in the Java Sound API the following but is the considered as standard practice to detect valid media file?
If the file being inspected (fileIn in this example) is not a sound file, or is a sound file of some unsupported type, an UnsupportedAudioFileException exception is thrown. This behavior is convenient, in that the application programmer need not be bothered with testing file attributes, nor with adhering to any file-naming conventions. Instead, the getAudioInputStream method takes care of all the low-level parsing and verification that is required to validate the input file.