@remotion/media-utils
Advanced tools
Comparing version 4.0.252 to 4.0.253
@@ -1,1 +0,1 @@ | ||
export declare const getWaveformSamples: (waveform: Float32Array, sampleAmount: number) => number[]; | ||
export declare const getWaveformSamples: (waveform: Float32Array, sampleAmount: number) => any[]; |
@@ -22,3 +22,8 @@ "use strict"; | ||
const max = Math.max(...filteredData); | ||
const multiplier = max === 0 ? 0 : max ** -1; | ||
// If the maximum amplitude is below this threshold, treat it as silence | ||
const MINIMUM_AMPLITUDE_THRESHOLD = 0.001; | ||
if (max < MINIMUM_AMPLITUDE_THRESHOLD) { | ||
return new Array(filteredData.length).fill(0); | ||
} | ||
const multiplier = max ** -1; | ||
return filteredData.map((n) => n * multiplier); | ||
@@ -25,0 +30,0 @@ }; |
@@ -6,3 +6,3 @@ { | ||
"name": "@remotion/media-utils", | ||
"version": "4.0.252", | ||
"version": "4.0.253", | ||
"description": "Utilities for working with media files", | ||
@@ -17,3 +17,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"remotion": "4.0.252" | ||
"remotion": "4.0.253" | ||
}, | ||
@@ -26,3 +26,3 @@ "peerDependencies": { | ||
"eslint": "9.14.0", | ||
"@remotion/eslint-config-internal": "4.0.252" | ||
"@remotion/eslint-config-internal": "4.0.253" | ||
}, | ||
@@ -29,0 +29,0 @@ "keywords": [ |
60822
1423
+ Addedremotion@4.0.253(transitive)
- Removedremotion@4.0.252(transitive)
Updatedremotion@4.0.253