-
Notifications
You must be signed in to change notification settings - Fork 1
/
SkHamPy.py
55 lines (36 loc) · 1.14 KB
/
SkHamPy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
##############################################
## last updated: Jul, 02 2009
##
## Charles Bock - Cbock at ASU dot EDU
##
##############################################
import re, os, sys, serial, time, pyTTS, datetime # holy shit
from DTMFdetector import DTMFdetector
from pyRecorder import Recorder
from pyRcCmd import Command
def Main():
Wav_File=str(os.path.abspath(os.path.dirname(sys.argv[0])) + "\\temp.wav")
Rec = Recorder()
Dtmf = DTMFdetector()
DtmfChars=""
re1='(CB)'
re2='(\\d\d\d\d\d\d\d\d\d\d)'
rg = re.compile(re1+re2,re.IGNORECASE|re.DOTALL)
print "Initialized and Ready"
while 1:
Rec.record(1,Wav_File)
Data = Dtmf.getDTMFfromWAV(Wav_File)
DtmfChars+=Data
txt = DtmfChars
m = rg.search(txt)
if m:
int1=m.group(2)
print "DTMF: " + DtmfChars
print "Dialing: " + int1
cmd = "C:\Documents\ and\ Settings\Deacon\Desktop\SkHamPy\call.py +1" + str(int1)
os.system(cmd)
DtmfChars=""
if __name__ == '__main__':
os.system("cls")
RcCom = Command()
Main()