Results 1 to 5 of 5
Thread: Convert microseconds to seconds
- 12-30-2009, 12:21 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 48
- Rep Power
- 0
Convert microseconds to seconds
Hi,
Hope you all will be fine.I know it's a very basic question but i don't know why i am unable to doing it. Anyways i want to find a length of a .wav file, for this, i use this code but it returns length in microseconds
and the output isJava Code:System.out.println( clip.getMicrosecondLength() );
5875000
i want this to be in seconds means if i convert this to seconds it becomes 5.875 sec, so i want that when i execute this line it gives me only 6 sec after rounding of or 5 or 20 sec only, means only int value no decimal value.
I also tried this
and alsoJava Code:System.out.println( clip.getMicrosecondLength()/0.000001 );
but i can't get the desired result. Please helpJava Code:System.out.println( (clip.getMicrosecondLength()/0.000001)%60 );
Thank you
- 12-30-2009, 12:24 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Read the API specs for the Math.round method.
-
Edit: Please ignore this brain fart. Sorry!
Last edited by Fubarable; 12-30-2009 at 12:59 PM.
- 12-30-2009, 12:30 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
- 12-31-2009, 05:54 AM #5
Member
- Join Date
- Aug 2009
- Posts
- 48
- Rep Power
- 0
Similar Threads
-
Difference in seconds between two times
By jazzy639 in forum New To JavaReplies: 11Last Post: 09-26-2009, 06:58 PM -
getting time elapsed in seconds
By ali_sakar in forum New To JavaReplies: 3Last Post: 03-06-2009, 08:37 AM -
Need help with calculate the number of seconds
By ProUnbeatable in forum New To JavaReplies: 5Last Post: 10-11-2008, 03:07 AM -
Transaction has timed out due to no client activity for greater than {1} seconds
By Sayed in forum Advanced JavaReplies: 1Last Post: 06-30-2008, 07:14 AM -
measuring time in nano seconds
By Java Tip in forum Java TipReplies: 0Last Post: 11-06-2007, 12:11 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks