1

So I have made a personal voice assistant in Python and it speaks currently with Microsoft David. There are some prebuilt voices to microsoft and you can add some more from settings and speech settings but not your own. I have two text to speech voices and one of them is what i want. So how do i select that voice? Here is code:

import pyttsx3
Assistant = pyttsx3.init('sapi5')
voices = Assistant.getProperty('voices')
Assistant.setProperty('voices', voices[0].id)
Assistant.setProperty('rate', 180)

def Speak(audio):
    print("  ")
    Assistant.say(audio)
    print(f"JARVIS: {audio}")
    print("  ")
    Assistant.runAndWait()
Frosty Boi FN
  • 21
  • 1
  • 3
  • if you are working on windows you can follow this approach https://puneet166.medium.com/how-to-added-more-speakers-and-voices-in-pyttsx3-offline-text-to-speech-812c83d14c13 – Bhavya Parikh Mar 31 '21 at 09:35
  • @BhavyaParikh no no i have my own tts voice i don't wanna add more which are of microsoft using this method, i have my own – Frosty Boi FN Mar 31 '21 at 09:53
  • okay got your point but i just known to this method. – Bhavya Parikh Mar 31 '21 at 10:02
  • Are these voices SAPI compatible? If they are, they should be available via the Voices property. Also, make sure the voices match the system architecture. 32 bit voices won’t be available in a 64 bit process. If not, well, you’ve got a LOT of work ahead of you. – Eric Brown Mar 31 '21 at 18:09
  • @EricBrown i downloaded it from the internet, i can see it in my system sound settings just no registry – Frosty Boi FN Apr 03 '21 at 11:02
  • You need to provide more information. What voices? Downloaded from where? What is the system architecture? Etc. – Eric Brown Apr 04 '21 at 14:43
  • @EricBrown ivona brian is voice name. It is a tts voice – Frosty Boi FN Apr 07 '21 at 12:43
  • I can't find much documentation on Ivona TTS; apparently they've been acquired by Amazon, and have ceased to sell their voices. In particular, I can't tell if these voices are actually SAPI compatible. Also, the little information I can get suggests that the voices are only 32-bit, which means that they won't be available in a 64 bit process. What do you get when you run `voices = engine.getProperty('voices') `? How many elements are returned? – Eric Brown Apr 08 '21 at 01:00
  • @EricBrown 4-5(All of Microsoft), I installed some from the registry method – Frosty Boi FN Apr 13 '21 at 06:44
  • Pyttsx3 uses SAPI 5, so if your voices aren't visible in the Advanced Speech Options control panel applet (Control Panel > Ease of Access > Speech Recognition; on the sidebar, select 'Text to Speech'), then your voices either aren't registered properly or are 32 bit voices. Beyond that, I can't help you. – Eric Brown Apr 13 '21 at 16:27
  • @EricBrown yo I can see it! – Frosty Boi FN Apr 18 '21 at 06:45
  • https://imgur.com/a/NibbKT8 – Frosty Boi FN Apr 18 '21 at 06:46

1 Answers1

-1

I guess you need to add the voices from settings in windows.

Here: https://www.youtube.com/watch?v=M4KeqY4nZEM

try to follow the steps in this video, might help

  • 2
    If you pointing to external sources such as this video, please provide a brief summary instead of saying it was guess. By saying it's a guess makes your answer not looked like an answer – Willy satrio nugroho Aug 14 '21 at 11:59