0

I was able to build a simple chatbot and I converted it to voice enabled voicebot with the help of this YouTube tutorial. So as the step 1) I convert voice input to text and step 2) convert bot message to audio clip and play it so the user can hear it. Since I am creating a voice clip inside my project folder, if multiple users try to use the bot at the same time I must have a mechanism to create unique voice clip for each chat session and play it. How to handle this kind of scenario?

user2397555
  • 67
  • 1
  • 11

1 Answers1

0

I solved it by shifting to pyttsx3 library

engine = pyttsx3.init()
voices = engine.getProperty('voices') 
engine.setProperty('voice', voices[1].id) #female voice
engine.say(bot_message)
engine.runAndWait()
user2397555
  • 67
  • 1
  • 11