Skip to content

Instantly share code, notes, and snippets.

@e-minguez

e-minguez/numbers.sh

Last active Aug 29, 2015
Embed
What would you like to do?
random number fm stream
#!/bin/sh
# Like lost numbers, but random :)
VOICE="es"
FREQ="101.6"
SPEEDMIN=100
SPEEDMAX=150
TYPEMIN=1
TYPEMAX=7
NUMMIN=1
NUMMAX=100
SLEEP=2
SHUF=/usr/bin/shuf
PIFM=/home/user/pifm/pifm
ESPEAK=/usr/bin/espeak
SUDO=/usr/bin/sudo
while true
do
SPEED=$(${SHUF} -i ${SPEEDMIN}-${SPEEDMAX} -n1)
TYPE=$(${SHUF} -i ${TYPEMIN}-${TYPEMAX} -n1)
MESSAGE=$(${SHUF} -i ${NUMMIN}-${NUMMAX} -n1)
[ $(${SHUF} -i 0-1 -n1) -eq 1 ] && MF="f" || MF="m"
${ESPEAK} -v${VOICE}+${MF}${TYPE} -s${SPEED} "${MESSAGE}" --stdout | ${SUDO} ${PIFM} - ${FREQ}
sleep ${SLEEP}
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment