Sign in to follow this  
Followers 0

Minute portion of formatted _SoundLenth

3 posts in this topic

Posted

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

Share this post


Link to post
Share on other sites



Posted

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

Share this post


Link to post
Share on other sites

Posted

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))

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0