Re: How to get Audio File properties
Manix wrote:
Can someone tell me which class I should look for to be able to get
and set the properties of an audio File (right-click on a file.
properties. resume - all the infos stocked there).
No it isn't. Windows does not do a 'bad' job of bringing up
that information, but it brings up incorrect times for VBR
MP3s. There would be other sound formats for which it
has no idea (that is 'no idea it is a sound format', let alone
the parameters with which it was encoded).
The thing is, I want to modify these properties in different audio
files with a java program I've created ...
Your new to this, I take it?
1) There are a plethora of sound formats.
2) Java is not especially good at dealing with that plethora.
3) OSs only understand the sound formats they have been
programmed to understand, unless they have some 'internet
based mechanism' to get new formats as they are
encountered (Win. does that - very clever).
4) Conversion of (e.g.) a 320Kbps MP3 to a mono, 8 bit,
16KHz, U-law encoded WAV is no simple matter. The
sound needs to be decoded from the old format, and encoded
in the new. Further, what do you do with the stereo tracks?
Merge them into a single mono track? Use 'left' only?
If you want to continue with this, look into the JavaSound API
(javax.sound.sampled, in J2SE since 1.3) or the JMF (extra,
mostly obsolete, abandoned API for media).
But ultimately, I do not think this is a good project
for Java, beginners in Java, or beginners in media,
and it is a lot more work (coding) than you think.
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via http://www.javakb.com