Guest User

Text to Speech on Mac OSX

a guest
Jun 21st, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.60 KB | None | 0 0
  1. Al ejecutar el Script en Mac OSX, salta el problema:
  2.  
  3. Jorge:Desktop jorge$ ./t2s.sh es Este es un texto muy interesante para convertir.
  4. /*_____________________________________________
  5. ---------------------------
  6. Speech Script by Dan Fountain
  7. TalkToDanF@gmail.com
  8. ---------------------------
  9. Playing line: 1 of 1
  10. ./t2s.sh: line 38: mpg123: command not found
  11. _____________________________________________*/
  12.  
  13. Haciendo una pequeña modificación en el Scrip, podemos reproducir el T2S con VLC añadiendo la siguiente línea:
  14. /Applications/VLC.app/Contents/MacOS/VLC
  15.  
  16. El Script quedaría así:
  17.  
  18. #!/bin/bash
  19.  
  20. #################################
  21. # Speech Script by Dan Fountain #
  22. # Modified by Pablo Castagnino  #
  23. # [email protected]          #
  24. #################################
  25.  
  26. INPUT=$*
  27. STRINGNUM=0
  28.  
  29. ary=(${INPUT:2})
  30. echo "---------------------------"
  31. echo "Speech Script by Dan Fountain"
  32. echo "---------------------------"
  33. for key in "${!ary[@]}"
  34. do
  35. SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
  36. LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
  37. #echo "word:$key, ${ary[$key]}"
  38. #echo "adding to: $STRINGNUM"
  39. if [[ "$LENGTH" -lt "100" ]]; then
  40. #echo starting new line
  41. SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
  42. else
  43. STRINGNUM=$(($STRINGNUM+1))
  44. SHORTTMP[$STRINGNUM]="${ary[$key]}"
  45. SHORT[$STRINGNUM]="${ary[$key]}"
  46. fi
  47. done
  48.  
  49. for key in "${!SHORT[@]}"
  50. do
  51. #echo "line: $key is: ${SHORT[$key]}"
  52.  
  53. echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))"
  54. /Applications/VLC.app/Contents/MacOS/VLC "http://translate.google.com/translate_tts?tl=${1}&q=${SHORT[$key]}"
  55. done
Advertisement
Add Comment
Please, Sign In to add comment