From bb2a2d136c72c75859ba30433ffea9635aba5e80 Mon Sep 17 00:00:00 2001 From: monoid Date: Thu, 21 Jul 2022 01:35:43 +0900 Subject: [PATCH] feat: add transform --- transform.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 transform.ts diff --git a/transform.ts b/transform.ts new file mode 100644 index 0000000..19e9aea --- /dev/null +++ b/transform.ts @@ -0,0 +1,12 @@ +import $ from "https://deno.land/x/dax@0.7.1/mod.ts"; + +import { expandGlob } from "https://deno.land/std@0.148.0/fs/mod.ts"; +import { relative, parse, resolve } from "https://deno.land/std@0.148.0/path/mod.ts"; + +for await (const file of expandGlob("*.wav")){ + const from = relative(Deno.cwd(),file.path); + const parsed = parse(from); + const to = resolve(parsed.dir,parsed.name+".flac") + console.log(from, to); + await $`ffmpeg -i ${from} ${to}` +} \ No newline at end of file