Skip to content

Instantly share code, notes, and snippets.

@tompaton
Last active August 26, 2017 10:33
Show Gist options
  • Save tompaton/5ce35be866efb91def8c9a86c7add5e4 to your computer and use it in GitHub Desktop.
Save tompaton/5ce35be866efb91def8c9a86c7add5e4 to your computer and use it in GitHub Desktop.
Makefile to pre-process downloaded podcasts
# process podcasts
MP3S = $(filter-out $(wildcard *.64kbit.mp3),$(wildcard *.mp3))
PROCESSED = $(patsubst %.mp3,%.64kbit.mp3,$(MP3S))
.PHONY: process
process: videos $(PROCESSED)
@echo Done.
.PHONY: videos
videos: $(wildcard *.mp4)
@if [ -n "$^" ]; then \
echo Moving $^. ; \
mv $^ video/ABC/ ; \
fi
%.64kbit.mp3: %.mp3
@echo Processing $^
@nice sox --no-show-progress --multi-threaded \
--buffer 32768 --norm "$<" "$@" \
tempo -s 1.33 channels 1 rate 22050
@# strip id3 tags so player puts all podcasts in the same folder
@id3v2 -D $@ > /dev/null
@mv $< reencode/original/
@echo Done $^
@tompaton
Copy link
Author

The goal is to:
a) reduce filesize of podcasts (192kbit/s is overkill for spoken word!)
b) normalize the volume and convert to mono (easier to listen to when riding/running and it's windy)
c) speed up playback (people talk too slow!)
d) strip tags (so my dinky mp3 player doesn't put the podcasts into different "folders")

Prerequisites:

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