Advertisement
berg

espeak_voice.py

Nov 29th, 2011
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. import os #import to give espeak command
  2. import Configure #import just to get the channel definition '##wzgm'
  3. import string #import to string manipulate
  4. #espeak script
  5. class Espeak_Voices():
  6.     def __init__(self,message):#message = buffer = IRC.recv(1024) irc output
  7.         msg = string.split(message)
  8.         nick_name = msg[0][:string.find(msg[0],"!")]
  9.         channel = msg[1]
  10.         nick = (string.lstrip(nick_name, ':'))
  11.         message = ' '.join(msg[3:])
  12.         print message
  13.         if msg [1] == 'PRIVMSG' and string.lstrip(msg[2], ':') == Configure.Channel:#channel ##wzgm but thats in the configure pie file
  14.             said = 'espeak -s 20 "' + nick + ' said,, ' + message.replace(':','') + '"'
  15.             print said
  16.             os.system(said)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement