Skip to content

Instantly share code, notes, and snippets.

@573
Last active March 12, 2017 12:59
Show Gist options
  • Save 573/04a2307be70eb852f298 to your computer and use it in GitHub Desktop.
Save 573/04a2307be70eb852f298 to your computer and use it in GitHub Desktop.
find and convert flacs to mp3s

either

find ./ -type f -regextype posix-egrep -regex '.*(flac)$' -exec flac2m3 {} \;

flac2mp3 being the following script:

#!/bin/bash
args=("$@")
avconv -i "$args" -qscale:a 0 "${args[@]/%flac/mp3}"

or everything at one line, i. e. (https://superuser.com/a/410323/432066):

find /run/user/1000/gvfs/smb-share\:server=sharedomain.local\,share=multimedia/Artist\ Name\ -\ The\ Album/ -type f -regextype posix-egrep -regex '.*(flac)$' -exec bash -c 'echo $(file="{}"; avconv -i "${file}" -qscale:a 0 "${file/%flac/mp3}")' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment