1

I am getting a error while running a pttsx3 code as root. So the code should save a file and say the words inputted. Here is the code:

import pyttsx3
engine = pyttsx3.init()
s1 = input("Words: ")
engine.say(s1)
engine.save_to_file(s1 ,'try.mp3')
engine.runAndWait()

And here is the error:

ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
aplay: main:831: audio open error: Device or resource busy

Running this code without root works, but I need to run it as root because I am adding it to another code that needs root. Note: I tried using gtts but I need a male voice to beatbox.

BOBERT
  • 13
  • 4
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 02 '22 at 21:27

0 Answers0