checkpoint

This commit is contained in:
Kuba Orlik 2020-05-15 21:48:24 +02:00
parent 17d59d4885
commit 684758857e

View File

@ -1,5 +1,3 @@
const editly = require("editly");
const graph_density = 1000; const graph_density = 1000;
const threshold_at_point = 1; const threshold_at_point = 1;
@ -51,28 +49,17 @@ process.stdin.on("readable", () => {
} }
}); });
process.stdin.on("end", () => { const mode_to_image = (mode: string) => {
console.log(results); return mode === "silence" ? "pics/cisza.png" : "pics/kuba.png";
const spec = {
outPath: "./out.mp4",
width: 800,
height: 600,
fps: 30,
defaults: { transition: { duration: 0 } },
audioFilePath: "/home/kuba/Downloads/odcinek1-kuba.wav",
clips: results.map((e) => ({
duration: s(e[1]),
layers: [
{
type: "title",
text: e[0] === "silence" ? " " : "Kuba Mówi",
position: "center",
},
],
})),
fast: true,
}; };
console.log(spec);
editly(spec).then(() => console.log("done!")); process.stdin.on("end", () => {
console.log(formatTime(total_speaking)); results.forEach(([mode, duration_units]) => {
console.log("file", `'${mode_to_image(mode)}'`);
console.log("duration", (duration_units / graph_density).toFixed(4));
});
console.log("file", `'${mode_to_image(results[results.length - 1][0])}'`);
// console.log(formatTime(total_speaking), formatTime(position));
}); });