Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Encode a podcast with metadata using command-line LAME
#!/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="ATP"
EPISODE_NUMBER=104
EPISODE_TITLE="Minutiæ"
EPISODE_SUMMARY="Please email us about Photos.app, UXKit, and React."
INPUT_WAV_FILE="atp${EPISODE_NUMBER}.wav"
# Artwork: ideally 1400x1400, but less than 128 KB to maximize compatibility
ARTWORK_JPG_FILENAME="${HOME}/Dropbox/ATP/Artwork.jpg"
# Output quality (kbps): 96 or 64 recommended
MP3_KBPS=96
lame --noreplaygain --cbr -h -b $MP3_KBPS --resample 44.1 --tt "$EPISODE_NUMBER: $EPISODE_TITLE" --tc "$EPISODE_SUMMARY" --ta "$SHOW_AUTHOR" --tl "$SHOW_AUTHOR" --ty `date '+%Y'` --ti "$ARTWORK_JPG_FILENAME" --add-id3v2 "$INPUT_WAV_FILE" "${INPUT_WAV_FILE%%.wav}.mp3"
@marcoarment

This comment has been minimized.

Show comment Hide comment
@marcoarment

marcoarment Feb 13, 2015

A few people have asked about that --resample argument. It's there to override LAME's default behavior of stepping down the sample rate (e.g. to 32 kHz) when using lower bitrates like 64 kbps.

Owner

marcoarment commented Feb 13, 2015

A few people have asked about that --resample argument. It's there to override LAME's default behavior of stepping down the sample rate (e.g. to 32 kHz) when using lower bitrates like 64 kbps.

@vallieres

This comment has been minimized.

Show comment Hide comment
@vallieres

vallieres Aug 29, 2016

Not thinking into account Forecast, do you still recommend these options for LAME?

I use lame -h -b 128 -m j --noreplaygain for 128kbits high quality, joint-stereo file. Any other settings you would recommend for the best possible quality in 2016?

Not thinking into account Forecast, do you still recommend these options for LAME?

I use lame -h -b 128 -m j --noreplaygain for 128kbits high quality, joint-stereo file. Any other settings you would recommend for the best possible quality in 2016?

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