How to get the length of a audio file without play it ?

Now I know a method to get the length of a audio file by play it:

1 Create a Player, and add a ControllerListener

2.Start the Player

3.In the ControllerListener's controllerUpdate method, use getMediaTime() by receiving a EndOfMediaEvent

However I think this method is not convenience, if I don't want to play it how I can get the length of the audio file?

Is anyone can help me?Really thanks a lot !

[439 byte] By [StarTrek29a] at [2007-11-26 22:04:13]
# 1
I got the answer here: http://forum.java.sun.com/thread.jspa?threadID=5149132&tstart=15I tried getDuration() before, but it always return a same time, I think maybe I didn't realize the player.
StarTrek29a at 2007-7-10 10:47:19 > top of Java-index,Security,Cryptography...
# 2
hey,its redirecting to my post., it will show the length only if the song starts playing...:-)
Spaniana at 2007-7-10 10:47:19 > top of Java-index,Security,Cryptography...