userdoc:tt_external_moh_source

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
userdoc:tt_external_moh_source [2014/02/18 09:15]
abelbeck [Internet Streaming]
userdoc:tt_external_moh_source [2014/02/19 06:31]
abelbeck [Internet Streaming]
Line 91: Line 91:
   #!/bin/sh   #!/bin/sh
      
-  wget -q -O - ${1| sox -t mp3 - -t raw -r 8000 -c 1 -+  # Set VOLUME variable to linearly multiply the volume by a number. 
 +  # Value: "0.8" is 80%, "1.2" is 120%, default is "1.0" when not defined. 
 +  VOLUME="0.8" 
 +   
 +  URL="$1" 
 +  if [ "$URL" != "${URL%.pls}" ]; then 
 +    PLAYLIST="$(wget -q -O - $URL)" 
 +    if [ $? -ne 0 ]; then 
 +      sleep 10 
 +      exit 1 
 +    fi 
 +    URL="$(echo "$PLAYLIST" | sed -n -r -e 's/^File[0-9]*=(.*)$/\1/p' | head -n1)" 
 +    if [ -z "$URL" ]; then 
 +      sleep 10 
 +      exit 1 
 +    fi 
 +  fi 
 + 
 +  if [ -n "$VOLUME" ]; then 
 +    FOPTS="-v $VOLUME" 
 +  else 
 +    FOPTS="" 
 +  fi 
 +   
 +  wget -q -O - $URL | sox -t mp3 $FOPTS - -t raw -r 8000 -c 1 -
  
 Make the "''/mnt/kd/bin/ast-stream-mp3''" file executable: Make the "''/mnt/kd/bin/ast-stream-mp3''" file executable:
  • userdoc/tt_external_moh_source.txt
  • Last modified: 2014/02/19 06:44
  • by abelbeck