Skip to content

Instantly share code, notes, and snippets.

@anandijain
Last active March 24, 2020 10:11
Show Gist options
  • Save anandijain/a4cb60d09028ac664b76ac9fa5f89235 to your computer and use it in GitHub Desktop.
Save anandijain/a4cb60d09028ac664b76ac9fa5f89235 to your computer and use it in GitHub Desktop.
youtube-dl + ffmpeg: url-> webm -> wav
#!/bin/sh
# requires youtube-dl and ffmpeg
# handy for musicians gathering samples
get_audio(){
youtube-dl -f251 $1 -o - | ffmpeg -i pipe: -ac 2 -f wav $2
}
# usage: get_audio "URL" "output.wav"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment