def call_say(self, txt: str, speed=None, pitch=None, literal=False):
if self.get_option(self.Options.USE_ESPEAK):
args = ["espeak"]
if pitch:
args += ["-p", str(pitch)]
if speed:
args += ["-s", str(speed)]
if literal:
txt = " ".join(txt)
args.append(txt)
else:
args = ["say"]
if pitch:
txt = f"[[ pbas +{pitch}]] {txt}"
if speed:
args += ["-r", str(speed)]
if literal:
txt = f"[[ char LTRL ]] {txt}"
args.append(txt)
if self.enabled:
logger.debug(f"Saying '{txt}'")
subprocess.run(args)
评论列表
文章目录