Advertisement
Guest User

Text to Speech on Mac OSX

a guest
Jun 21st, 2014
376
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. # TalkToDanF@gmail.com          #
  24. #################################
  25.  
  26. INPUT=$*
  27. STRINGNUM=0
  28.  
  29. ary=(${INPUT:2})
  30. echo "---------------------------"
  31. echo "Speech Script by Dan Fountain"
  32. echo "TalkToDanF@gmail.com"
  33. echo "---------------------------"
  34. for key in "${!ary[@]}"
  35. do
  36. SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
  37. LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
  38. #echo "word:$key, ${ary[$key]}"
  39. #echo "adding to: $STRINGNUM"
  40. if [[ "$LENGTH" -lt "100" ]]; then
  41. #echo starting new line
  42. SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
  43. else
  44. STRINGNUM=$(($STRINGNUM+1))
  45. SHORTTMP[$STRINGNUM]="${ary[$key]}"
  46. SHORT[$STRINGNUM]="${ary[$key]}"
  47. fi
  48. done
  49.  
  50. for key in "${!SHORT[@]}"
  51. do
  52. #echo "line: $key is: ${SHORT[$key]}"
  53.  
  54. echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))"
  55. /Applications/VLC.app/Contents/MacOS/VLC "http://translate.google.com/translate_tts?tl=${1}&q=${SHORT[$key]}"
  56. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement