2017-04-24 3 views
1

기록 할 수있는 pyttsx 포크를 발견했습니다.pyttsx : 한 번 기록 시작 중지

engine =pyttsx.init() 
voices = engine.getProperty('voices') 
engine.setProperty('voice', voices[0].id) #change index to change voices 
engine.rec('test this out','test.wav') 

문제는 ... 난 쉘을 닫지 않고 파일을 열 수 없습니다 : https://github.com/hick/pyttsx/tree/master/pyttsx

여기 내 코드입니다. 하지만 mp3로 인코딩하는 등 더 많은 코드를 실행해야합니다.

나는 이미 engine.stop()을 시도했다. 그리고 여기를 보았다 : https://github.com/hick/pyttsx/blob/master/pyttsx/engine.py ...

+0

이 새 터미널이나 창을 열 수 있습니다. – Shiping

답변

0

사용 pyttsx3 대신 pyttsx의 :

import pyttsx3 

engine = pyttsx3.init() 
engine.say('Nice to meet you') 
engine.runAndWait()