WMA format

Hi all ,i am trying find tha time duration of wma file , does jmf support wma format. Is thr any other way or api from which i can play or find duration of wma file format.thanks in advancemurali
[223 byte] By [muralisjcea] at [2007-10-3 10:41:59]
# 1
Take a look at one of the previous threads http://forum.java.sun.com/thread.jspa?threadID=787790&tstart=0They are discussing how to enable using WMA in JMF on the first place. Maybe, when you make WMA work on JMF, then you can extract the length of your file.
andreyvka at 2007-7-15 6:05:49 > top of Java-index,Security,Cryptography...
# 2

Hello every body..

u say that u want to get the duration time of WMA format, i guess that u can get the duration time of another format such as ( mov,avi,..) so please if u have method or code to get the duration time of a file to send it to me...

If there is only a way to get the duration timr of amedia with the format

hour:miniute:seconds ,,, please send it to me as fast as u can...

thanks again..

shadya at 2007-7-15 6:05:49 > top of Java-index,Security,Cryptography...
# 3

> i guess that u can get the duration time of another

> format such as ( mov,avi,..)

The JavaDocs are immensely handy, way better

than guessing, you should try consulting them.

http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/index.html

http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/javax/media/Duration.html

'getDuration()' - note it is used in a variety of other interfaces

Controller, Demultiplexer, Player, Processor, Track

AndrewThompson64a at 2007-7-15 6:05:49 > top of Java-index,Security,Cryptography...
# 4

hi shady,

this is the code which works for all type of media format other than wma..

Player player = null;

URL url;

url = new URL("file:///" + path);

//path is ur file path

player = Manager.createRealizedPlayer(url);

long timeInSeconds = (long) player.getDuration().getSeconds();

long hours, minutes, seconds;

hours = timeInSeconds / 3600;

timeInSeconds = timeInSeconds - (hours * 3600);

minutes = timeInSeconds / 60;

seconds = timeInSeconds % 60;

System.out.println("Duration of " + path + " = "

+ (hours < 10 ? "0" : "") + hours + ":"

+ (minutes < 10 ? "0" : "") + minutes + ":"

+ (seconds < 10 ? "0" : "") + seconds);

player.stop();

player.close();

muralisjcea at 2007-7-15 6:05:49 > top of Java-index,Security,Cryptography...