diff --git a/services/audio.js b/services/audio.js index a4b9f1c..cea7e6d 100644 --- a/services/audio.js +++ b/services/audio.js @@ -86,6 +86,13 @@ function split (sourceFile, destinationPath, maxDuration) { } } catch (e) { reject(e) } }) + /* + * There is a very rare case that the segment is very small, 0.0000x second. + * With this small segment, the sample count will be null so we have to exclude it + */ + if (!outputFiles[outputFiles.length - 1].meta.sampleCount) { + outputFiles.pop() + } resolve(Promise.all(outputFiles)) }) .run() diff --git a/services/rfcx/ingest.js b/services/rfcx/ingest.js index 3706f3b..ac59f93 100644 --- a/services/rfcx/ingest.js +++ b/services/rfcx/ingest.js @@ -188,13 +188,6 @@ function combineSegmentsData (outputFiles, upload) { fileSize: file.meta.size } }) - /* - * There is a very rare case that the segment is very small, 0.0000x second. - * With this small segment, the sample count will be null so we have to exclude it - */ - if (!combinedData[combinedData.length - 1].sampleCount) { - combinedData.pop() - } return combinedData }