
376
|
Chapter 10, Audio
#74 Add MP3 Support to JMF
HACK
Running the Code
Like the JMF port [Hack #72], QTJSound looks and feels more or less the same as
the original CoreJavaSound
[Hack #71]
. The big difference is in the supported
sound file formats. QuickTime will open not just uncompressed WAVs and
AIFFs, but compressed data in those formats, along with MP3s, AACs,
3GPP mobile audio files, iTunes Music Store files, audio tracks of various
audio/video formats like QuickTime movies (.mov), MPEG-4, even audio
CD tracks (but only on the Mac).
That’s obviously the big win with QuickTime for Java: you get support for a
lot more formats. The price you pay is that your code only runs on two
operating systems and that it can be difficult to write. The ideal would be if
the obvious points of extensibility in JavaSound and JMF had been
exploited, so that more formats would be available when using those APIs.
With a notable exception
[Hack #74], that hasn’t happened yet.
By the way, to learn more about QuickTime for Java, check
out QuickTime for Java: A Developer’s Notebook (O’Reilly).
H A C K
#74
Add MP3 Support to JMF Hack #74
MP3s are everywhere, and by installing a plug-in you can use them with Java
Media Framework, too.
It used to be said that every program will continue to grow until it includes
an email reader. Today we could say the same for MP3 players. They are
everywhere, and any program that has plug-ins ...