pico2wave.py 276 B

12345678910
  1. import subprocess
  2. import os
  3. def say(words):
  4. tempfile = "temp.wav"
  5. devnull = open("/dev/null", "w")
  6. subprocess.call(["pico2wave", "-l=fr-FR", "-w", tempfile, words], stderr=devnull)
  7. subprocess.call(["aplay", tempfile], stderr=devnull)
  8. os.remove(tempfile)