Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Forked from tayiorbeii/mp4-to-mp3s.js
Created December 21, 2022 21:39
Show Gist options
  • Save johnlindquist/de498fdc10cf404c0598085ebdcd7423 to your computer and use it in GitHub Desktop.
Save johnlindquist/de498fdc10cf404c0598085ebdcd7423 to your computer and use it in GitHub Desktop.
import "@johnlindquist/kit"
/*
* Highlight the long video we are taking clips out of in Finder
*/
let longVideoFiles = await drop()
/**
* Tell kit we want to be working in the same directory as the source file
*/
cd(path.dirname(longVideoFiles[0].path))
for (let longVideoFile of longVideoFiles) {
await exec(`ffmpeg -i "${longVideoFile.path}" -b:a 96k -vn "${longVideoFile.path.slice(0,-4)}.mp3"`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment