0

Is there a way to randomly generate voices using Python?

I have no idea where to start, but my best guess would be doing something along these lines:

class CustomVoice(voice)
    def __init__(self, pitch):
        self.pitch = pitch

I cannot seem to find a base object to clone it off though.

Any help would be greatly appreciated

1 Answers1

0

Actually the question is not clear... But I can help you with this...

To generate a voice in python, there are many ways like Online and Offline. But for the sake of simplicity, I am going to demonstrate the offline way to get your issue done fast.

Step 1 : Install the pyttsx3 library

pip install pyttsx3

Step 2 : Import the Library in the python code

import pyttsx3

Step 3 : Prepare the text

toSay = "Hello I am the Voice from python "

Step 4 : Say !

engine.say(toSay)

Step 5 : Actually Say !

engine.runAndWait()

That's done !

AAYUSH SHAH
  • 131
  • 2
  • 6
  • Sorry about the clarity issue. I'm asking how do I generate a type of voice. Like the voice that it's saying it with. For example, the voice metadata has an age factor, which I assume changes the pitch of the sentence? (this is mainly what i'm looking for, since you can already change speed) – TheDevelopingCookie Jan 07 '20 at 02:22