+if [ -z "$play" ]; then
+ while :; do
+ echo
+ echo "How do you want to play sound? Enter 'local' to use a local sound"
+ echo "device or 'network' to multicast sound across your network."
+ read -r play
+ case $play in
+ 'local' | network )
+ break
+ ;;
+ * )
+ echo "Enter 'local' or 'network'"
+ continue
+ ;;
+ esac
+ done
+fi
+
+if [ "x$play" = xnetwork ]; then
+ if [ -z "$mcast_address" ]; then
+ echo
+ echo "Enter destination address for network transmission"
+ echo "(e.g. a multicast address)"
+ read -r mcast_address
+ fi
+ if [ -z "$mcast_port" ]; then
+ while :; do
+ echo
+ echo "Enter destination port for network transmission"
+ read -r mcast_port
+ case $mcast_port in
+ none )
+ break
+ ;;
+ [^0-9] | "" )
+ echo "'$mcast_port' is not a valid port number"
+ continue
+ ;;
+ * )
+ break
+ ;;
+ esac
+ done
+ fi