Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Minute portion of formatted _SoundLenth


  • Please log in to reply
2 replies to this topic

#1 CYCho

CYCho

    Seeker

  • Active Members
  • 5 posts

Posted 05 January 2008 - 02:09 AM

For a file length of 7000000 milliseconds, the formatted _SoundLenth returns "01:116:40" instead of "01:56:40".

If you look at _SoundLenth function of Sound.au3, the source of the bug is evident.

This
    $iSnd_len_min = Int($iSnd_len_ms / 60000)     $iSnd_len_hour = Int($iSnd_len_min / 60)     $iSnd_len_sec = Int(Int($iSnd_len_ms / 1000) - ($iSnd_len_min * 60))


should be changed to:
CODE
$iSnd_len_min = Int($iSnd_len_ms / 60000)
$iSnd_len_hour = Int($iSnd_len_min / 60)
$iSnd_len_sec = Int(Int($iSnd_len_ms / 1000) - ($iSnd_len_min * 60))
$iSnd_len_min = $iSnd_len_min - ($iSnd_len_hour * 60)


Regards,

CYCho







#2 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,749 posts

Posted 05 January 2008 - 01:21 PM

For a file length of 7000000 milliseconds, the formatted _SoundLenth returns "01:116:40" instead of "01:56:40".

If you look at _SoundLenth function of Sound.au3, the source of the bug is evident.

This

    $iSnd_len_min = Int($iSnd_len_ms / 60000)     $iSnd_len_hour = Int($iSnd_len_min / 60)     $iSnd_len_sec = Int(Int($iSnd_len_ms / 1000) - ($iSnd_len_min * 60))


should be changed to:
CODE
$iSnd_len_min = Int($iSnd_len_ms / 60000)
$iSnd_len_hour = Int($iSnd_len_min / 60)
$iSnd_len_sec = Int(Int($iSnd_len_ms / 1000) - ($iSnd_len_min * 60))
$iSnd_len_min = $iSnd_len_min - ($iSnd_len_hour * 60)
Regards,

CYCho

Thanks :)
Fixed 3.2.11.0

#3 Nutster

Nutster

    Developer at Large

  • Developers
  • 1,450 posts

Posted 05 January 2008 - 03:58 PM

You could use the Mod function instead.
    $iSnd_len_hour = Int($iSnd_len_ms / 3600000)     $iSnd_len_min = Int(Mod($iSnd_len_ms, 3600000) / 60000)     $iSnd_len_sec = Int(Mod($iSnd_len_ms, 60000) / 1000))

David Nuttall

Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius
AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users