Skip to content

Instantly share code, notes, and snippets.

@matt-the-ogre
Last active August 29, 2015 14:16
Show Gist options
  • Save matt-the-ogre/e4f124bf95e0f1d4c160 to your computer and use it in GitHub Desktop.
Save matt-the-ogre/e4f124bf95e0f1d4c160 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Encode a WAV to a finalized podcast MP3 with metadata, in the current directory
# Requires lame
# With Homebrew on Mac OS X: brew install lame
SHOW_AUTHOR="K. Manuel"
LECTURE_DATE=$1
LECTURE_INDEX=$2
EPISODE_TITLE="Chemistry"
EPISODE_SUMMARY="Chemistry Lecture"
INPUT_WAV_FILE="${LECTURE_DATE}_${LECTURE_INDEX}.MP3"
# Artwork: ideally 1400x1400, but less than 128 KB to maximize compatibility
ARTWORK_JPG_FILENAME="${HOME}/Dropbox/Artwork.jpg"
# Output quality (kbps): 96 or 64 recommended
MP3_KBPS=96
lame --noreplaygain --cbr -h -b $MP3_KBPS --resample 44.1 --tt "$LECTURE_DATE: $EPISODE_TITLE" --tc "$EPISODE_SUMMARY" --ta "$SHOW_AUTHOR" --tl "$SHOW_AUTHOR" --ty `date '+%Y'` --ti "$ARTWORK_JPG_FILENAME" --add-id3v2 "$INPUT_WAV_FILE" "$EPISODE_TITLE-${INPUT_WAV_FILE%%.MP3}.mp3"
@matt-the-ogre
Copy link
Author

changing to work with Chemistry Lecture recordings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment