|
import pyttsx3
#vol=e.getProperty("volume")
#e.setProperty(\'vol\',vol+0.5)
#pp.startLoop()
#e=pyttsx3.init()
#e.say("深圳全飞鸿")
#e.runAndWait()
tts = pyttsx3.init()
#ens = tts.getProperty('voices')
#for en in ens:
# print(en.id)
#tts.setProperty('voice', tts.getProperty('voices')[0].id)
#vol=tts.getProperty("volume")
#0~1
tts.setProperty('volume', 1)
#0~200
tts.setProperty('rate', 200)
word="扫外箱号"
word="错误,扫外箱号"
word="扫内箱号"
word="装箱完成"
word="外箱号正确"
word="错误,扫内箱号"
word="内箱号正确"
word="OK"
word="错误,扫内箱号"
word="重复扫描"
word="装箱完成"
word="装箱失败"
word="流程错误"
word="箱号重复"
word="内箱完成"
word="装箱完成"
word="错误,重复扫描"
tts.save_to_file(word, "./cc.mp3")
#tts.save_to_file(word, "./cc.wav")
tts.say(word)
tts.runAndWait()
|
|