script/transform.ts

12 lines
463 B
TypeScript
Raw Permalink Normal View History

2022-07-21 01:35:43 +09:00
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";
2022-07-21 01:51:20 +09:00
for await (const file of expandGlob("**/*.wav")){
2022-07-21 01:35:43 +09:00
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}`
}