Advertisement
Guest User

Voice TTS with cache

a guest
Feb 27th, 2015
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. EXP=`echo -n $1 | md5sum | awk '{print $1}'`
  4. DIR=cache
  5.  
  6. if [ ! -f $DIR/$EXP.mp3 ]; then
  7.  
  8. wget --user-agent "Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13" \
  9.     -O $DIR/$EXP.mp3 \
  10.     "http://translate.google.com/translate_tts?tl=fr&q=$1"
  11. fi
  12.  
  13. mpg321 -g 100 $DIR/$EXP.mp3
  14. #yatm -t 1.3 $DIR/$EXP.mp3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement