Skip to content

Instantly share code, notes, and snippets.

@skyblue
Created November 2, 2012 13:30
Show Gist options
  • Save skyblue/4001377 to your computer and use it in GitHub Desktop.
Save skyblue/4001377 to your computer and use it in GitHub Desktop.
encode audio files
#! /usr/bin/env bash
set -e
target=$1; shift
for file; do
case $target in
mp3) sox "$file" -S -r 22k -c 1 -L "${file%.*}.mp3" ;;
caf) afconvert -d 'ima4' -f 'caff' "$file" "${file%.*}.caf" ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment