Skip to content

Instantly share code, notes, and snippets.

@pwqw
Created January 4, 2017 23:13
Show Gist options
  • Save pwqw/0f1b2ddc9c4796d5576b44aabe1e61b9 to your computer and use it in GitHub Desktop.
Save pwqw/0f1b2ddc9c4796d5576b44aabe1e61b9 to your computer and use it in GitHub Desktop.
Search and convert all wav to mp3 audio files
#!/bin/bash
# requires ffmpeg
# apt install ffmpeg
find . -type f -iname "*.wav" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -acodec libmp3lame -ac 2 -ab 320k -ar 48000 "${FILE%.wav}.mp3";' _ '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment