Skip to content

Commit

Permalink
renamed file to talk.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fs111 committed Oct 2, 2009
1 parent dce670f commit f2eb218
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/silentguy.py → src/talk.py
@@ -1,17 +1,19 @@
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE

p = Popen(["espeak -s 40 -p 99 -v en "], shell=True,
stdin=PIPE, stdout=PIPE, close_fds=True)

COMMAND = ".talk"

process = Popen(["espeak -s 40 -p 99 -v en "], shell=True,
stdin=PIPE, stdout=PIPE, close_fds=True)

def sayitoutloud(what):
p.stdin.write(what + "\n")
"""writes the text to the stdin of the espeak process"""
process.stdin.write(what + "\n")



def talk(phenny, input):
"""Callback that phenny calls when somone issues the .talk command"""
input = input.replace(COMMAND, "")
sayitoutloud(input)

Expand Down

0 comments on commit f2eb218

Please sign in to comment.