If it's only mp3's you're looking for then a quick and dirty approach is
to just retrieve X bytes of the mp3. mp3's are streamed so if you
truncate them you can still play them, they're just shorter. You'd have
to experiment to see how many bytes would give you about 5 seconds.

You could probably take a similar approach with a lot of sound files,
Waves for instance.

-----Original Message-----
From: jeff [mailto:[EMAIL PROTECTED] 
Sent: 19 January 2006 03:45 PM
To: [email protected]
Subject: [CTJUG Forum] MP3 / Audio Truncation


Hi All

I  need to get the first 5 seconds of an MP3 or any sound file for that 
matter.

My MP3's are stored as byte[] in a database.  Having looked at a number 
of different  java API's (well only sound and JMF really) and not having

any experience with any java media coding, I am hoping someone can point

me in the right direction.....even some code sample :) would be nice.

Thanks in advance
Jeff


Reply via email to