main.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from time import sleep
  4. from DynLoader import DynLoaderMod as dyn
  5. from VoicePlay import Voice as speach
  6. from Stats import Stats
  7. from Jessi import Text as textauswahl
  8. from PicoVoice import PicoVoice
  9. import os
  10. import sys
  11. import colorama
  12. from colorama import Fore, Back, Style
  13. from listener import Lis
  14. def WeakWord(index,weakword):
  15. print(f"Weakword {Fore.GREEN}[{index}]{Fore.CYAN}{weakword}{Style.RESET_ALL}")
  16. if __name__ == "__main__":
  17. os.system('color')
  18. print(f"Start {Fore.GREEN}Application{Style.RESET_ALL}")
  19. print(f"Init {Fore.GREEN}Mods{Style.RESET_ALL}")
  20. mod = dyn("mods/", "on")
  21. print(f"Init {Fore.GREEN}Stats{Style.RESET_ALL}")
  22. stats:Stats = Stats.getInstance()
  23. print(f"Init {Fore.GREEN}Speech{Style.RESET_ALL}")
  24. speach.getInstance().Say(".")
  25. mod.execute("PlaySound", "welcome.wav", False)
  26. print("Sound playing...")
  27. pico:PicoVoice = PicoVoice.getInstance()
  28. PicoVoice.show_audio_devices()
  29. pico.RegisterOnWeakWord(WeakWord)
  30. pico.start()
  31. Lis.Start()
  32. sleep(60)
  33. Lis.Stop()
  34. try:
  35. inp=""
  36. while inp!="qqq" and inp!="quit" and inp!="q":
  37. inp=input()
  38. except (KeyboardInterrupt, SystemExit):
  39. pass
  40. print("Exit")