From e242a07969f7682b7d51b35d04fc877c3a873d93 Mon Sep 17 00:00:00 2001 From: Jonathan Mumm Date: Fri, 14 Jan 2022 06:53:55 -0800 Subject: [PATCH] Fix duration to include partial seconds Currently the duration parsing from the ffmpeg string throws out the fraction of a second to get the duration. This causes the number of samples to be calculated incorrectly later on. I added a line to the duration parsing to add the fraction. --- waveform-node.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/waveform-node.js b/waveform-node.js index d8eaa77..243269f 100644 --- a/waveform-node.js +++ b/waveform-node.js @@ -91,6 +91,8 @@ var getDataFromFFMpeg = function(filepath, options, callback){ duration *= 60; duration += val; } + duration = duration + (parseInt(strList[3]) / 100); + var channels = matches2[2];