Easier way to configure volume threshold (an exported variable in generate.sh)

This commit is contained in:
Kuba Orlik 2023-12-28 13:07:15 +01:00
parent d96d4373f4
commit a6e89ee5ad
2 changed files with 56 additions and 65 deletions

View File

@ -2,7 +2,7 @@ import findLoudness, { SwapPoint } from "./find-loudness";
const graph_density = 8000;
const threshold_at_point = 1;
const threshold_at_point = parseInt(process.env.demuxer_volume_threshold) || 1;
const inertia_s = 0.3;
const inertia_samples = inertia_s * graph_density;
@ -20,18 +20,8 @@ type Mode = { left: boolean; right: boolean };
async function run() {
const [left_breaks, right_breaks] = await Promise.all([
findLoudness(
"/tmp/leftraw",
threshold_at_point,
inertia_samples,
"left"
),
findLoudness(
"/tmp/rightraw",
threshold_at_point,
inertia_samples,
"right"
),
findLoudness("/tmp/leftraw", threshold_at_point, inertia_samples, "left"),
findLoudness("/tmp/rightraw", threshold_at_point, inertia_samples, "right"),
]);
const merged = [...left_breaks, ...right_breaks].sort((a, b) =>

View File

@ -6,13 +6,14 @@
# W katalogu z tym skryptem musisz mieć katalog "pics", w którym są pliki "left.png", "right.png", "none.png" i "both.png"
#
export input=~/Downloads/icdw3/stereo-processed.wav # tutaj dajemy ścieżkę do pliku mp3 z Arkiem w jednym kanale i Kubą w drugim
export input_mono=~/Downloads/icdw3/mono-processed.wav # tutaj dajemy ścieżkę do pliku mp3 z Arkiem w jednym kanale i Kubą w drugim
export input=~/Downloads/icdw5/icdw5-stereo.wav # tutaj dajemy ścieżkę do pliku mp3 z Arkiem w jednym kanale i Kubą w drugim
export input_mono=~/Downloads/icdw5/icdw5-stereo.wav # tutaj dajemy ścieżkę do pliku mp3 z Arkiem w jednym kanale i Kubą w drugim
export intro=~/projects/midline/podcast-visualizer/out/intro.mp4 # glitch
export outro=~/projects/midline/podcast-visualizer/out/intro.mp4 # to samo na końcu, co na początku
export final_output=~/Downloads/icdw3-viz.mp4
export final_output=~/Downloads/icdw5-viz.mp4
export framerate=25
export timescale=25000
export demuxer_volume_threshold=30 #od 0 do 128
aresample=8000 # to bez zmian
mkdir -p out