Skip to content

Instantly share code, notes, and snippets.

@thewhodidthis
Last active September 4, 2023 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewhodidthis/1c2665a75d6d9d4be47e39b1ba149eb2 to your computer and use it in GitHub Desktop.
Save thewhodidthis/1c2665a75d6d9d4be47e39b1ba149eb2 to your computer and use it in GitHub Desktop.
FMU MP3 episode download, edit, and archive
YEAR?=$$(date +%Y)
UUID?=$$(python -c "import uuid; print(uuid.uuid4())")
ITEM?=justmoreidlechatternot
BOOM?=$(notdir $(CURDIR))
SHOW?=WA
NAME?=$$(date +%Y%m%d%s)
run: get cut mp3 put
@rm -rf episode.mp3 *.wav
put:
@ia upload $(ITEM) sample.mp3 -q -r sample.mp3 -m "title:$(NAME)" -m "mediatype:audio" -m "collection:opensource_audio" -m "year:$(YEAR)" -m "chatter:NOT"
cut:
@mpg123 -s -q -k 2400 -n 1200 -w sample.wav episode.mp3
mp3:
@lame --quiet -b 128 sample.wav sample.mp3
get:
@curl -LSs "http://www.wfmu.org/archivefeed/mp3/${SHOW}.xml" | xmllint --xpath "string(/rss/channel/item[1]/link)" - | xargs curl -LSs | xargs curl -LSs > episode.mp3
test/tone:
ffmpeg -f lavfi -i "sine=frequency=1000:duration=1" test.mp3
test/disk:
@df -B 1 -P . | tail -1 | awk '{print $$4}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment