You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
882 B

  1. #!/bin/bash
  2. ## import common lib
  3. . "$HOME/.noaa.conf"
  4. . "$NOAA_HOME/common.sh"
  5. if [ -z "$1" ]; then
  6. log "Usage: $0 <frequency>. Example: $0 90.3" "ERROR"
  7. exit 1
  8. fi
  9. command_exists() {
  10. if ! command -v "$1" &> /dev/null; then
  11. log "Required command not found: $1" "ERROR"
  12. exit 1
  13. fi
  14. }
  15. command_exists "sox"
  16. command_exists "socat"
  17. IP=$(ip route | grep "link src" | awk {'print $NF'})
  18. if pgrep "rtl_fm" > /dev/null
  19. then
  20. log "There is an existing rtl_fm instance running, I quit" "ERROR"
  21. exit 1
  22. fi
  23. echo "$(tput setaf 2)
  24. The server is in testing mode tuned to $1 Mhz!
  25. Open a terminal in your computer and paste:
  26. ncat $IP 8073 | play -t mp3 -
  27. $(tput sgr0)
  28. "
  29. rtl_fm ${BIAS_TEE} -f "$1M" -s 256k -g 48 -p 55 -E deemp -F 9 - \
  30. | sox -traw -r256k -es -b16 -c1 -V1 - -tmp3 - \
  31. | socat -u - TCP-LISTEN:8073 1>/dev/null