Skip to content

Instantly share code, notes, and snippets.

@hsiboy
Created September 7, 2018 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hsiboy/0dff77dc68f505e06eb8c2b2cde4bce3 to your computer and use it in GitHub Desktop.
Save hsiboy/0dff77dc68f505e06eb8c2b2cde4bce3 to your computer and use it in GitHub Desktop.
Record Radio4 FM from Winter Hill. to record Shipping Forecast.
#!/bin/bash
# Record radio4 FM from Winter Hill.
# To be triggered by cron to record Shipping Forecast.
# "timeout" will send a SIGTERM to rtl_fm to abort the recording after 5 mins.
# Afterwards the wav file is converted to 11025 sample rate using sox.
# "touch" will transfer the original timestamp to the new file
# the original rtl_fm wav-file is deleted.
timeout -s SIGTERM 300s rtl_fm -M wbfm -f 93M -s 60k -g 20 -E wav -F 0 radio4fm.wav
sox -t wav radio4fm.wav radio4.wav rate 11025
touch -r radio4fm.wav radio4.wav
rm radio4fm.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment