-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathritaconstt
34 lines (31 loc) · 982 Bytes
/
ritaconstt
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
import os
from pocketsphinx import LiveSpeech
import behavior.naochat.aiml as aiml
import time
from subprocess import call
k = aiml.Kernel()
k.learn = ("std-startup.xml")
k.respond ("LOAD AIML B")
cmd_beg = ('Espeak -ves+f3')
cdm_end = ' 2 dev null'
os.system ("clear")
call ([cmd_beg "Estoy_lista_hola!"+cmd_end], shell=True)
print ("Rita : te escucho")
speech = LiveSpeech(
verbose = False,
sampling_rate = 16000,
buffer_size = 2048,
no_search = False,
full_utt = False,
hmm= '/home/pi/Desktop/RITAV2/cmusphinx-es-5.2/model-parameters/voxforge_es_sphinx.cd_pta-4000',
lm= '/home/pi/Desktop/RITAv2/es-20k.lm.gz',
dic= /home/pi/Desktop/RITAv2/es.dict'
)
for phrase in speech:
a = str(phrase)
print("USUARIO "+a)
Cadena = k.respond(a)
print ("RITA: " + Cadena)
Cadena = Cadena.replace(' ', '_')
call([cmd_beg+Cadena+cmd_end], shell=True)
print("RITA: te escucho")