« get me outta code hell

Improve duration accuracy in SoX player - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-04-08 11:29:16 -0300
committerFlorrie <towerofnix@gmail.com>2018-04-08 11:29:16 -0300
commitdb7cd9742b271dad089b3fdffb099c05a599d0f5 (patch)
tree7a9b7dff6cb8d44597a78fffe982aa40a8b30d8e /src
parentd459445c61e62d9c349a3276cbfaac54f584e1e8 (diff)
Improve duration accuracy in SoX player
Diffstat (limited to 'src')
-rw-r--r--src/loop-play.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index c838ea7..760e63a 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -218,7 +218,8 @@ class SoXPlayer extends Player {
           const duration = Math.round(
             (curHour + remHour) * 3600 +
             (curMin + remMin) * 60 +
-            (curSec + remSec) * 1
+            (curSec + remSec) * 1 +
+            (curSecFrac + remSecFrac) / 100
           )
 
           const lenHour = Math.floor(duration / 3600)