def __init__(self, engine='witai', wavfile='/files/sound.wav'):
self.directorycurrent = os.path.dirname(os.path.realpath(__file__))
self.wavfile = self.directorycurrent + wavfile
print self.wavfile
self.engine = engine
self.r = sr.Recognizer()
with sr.WavFile(self.wavfile) as self.source:
self.audio = self.r.record(self.source)
评论列表
文章目录