Skip to content

Instantly share code, notes, and snippets.

View rocket-pig's full-sized avatar

rocket-pig

  • low orbit
View GitHub Profile
@rocket-pig
rocket-pig / cache_gtts.py
Last active March 25, 2018 23:32
Added some amount of control over logging verbosity. Can now see a nice count of new/cached words. Also kludged in some copypasta to remove trailing/leading silence, which helps it be less gappy playing back.
#!/usr/bin/python3
#### Google TTS multithreaded cacher. Download the word once, never again!
#### There's a fair amount of 'anonymization' too, as it would be impossible
#### to determine what the un-cached sentence structure was, or whether
#### words were already cached and played locally.
#sets crossfade between words, for some amount of 'smoothing'
crossfade_amount = 40
#sets fade_in/out amount, for less abruptness also
#!/usr/bin/python2
import os
import sys
import base64
import requests
def get_wave(fname):
with open(fname) as infile:
return base64.b64encode(infile.read())
#!/usr/bin/python2
import snowboydecoder,os
import sys
import signal
from commands import getoutput as cgo
from time import sleep
interrupted = False
#if you want to change the trigger message,
#record a new model with make_model.py modelname
curl -s http://127.0.0.1:8080/requests/status.xml -u :password > /tmp/vlcstatus
cat /tmp/vlcstatus | sed '/^<state/!d' | sed 's/<state>//g' | sed 's/<\/state>//g'