Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Linux:
- #
- # pip install pyttsx3
- # apt install espeak
- # apt install libespeak1 # I'm not sure. Maybe espeak will install it.
- #
- # http://pyttsx.readthedocs.io/en/latest/index.html
- # http://espeak.sourceforge.net/languages.html
- #
- import pyttsx3
- engine = pyttsx3.init()
- print('voices:')
- for item in engine.getProperty('voices'):
- print(item.name)
- print('---')
- print('voice:', engine.getProperty('voice'))
- print('rate:', engine.getProperty('rate'))
- print('volume:', engine.getProperty('volume'))
- print('---')
- engine.setProperty('voice', 'english')
- engine.say('Good Day, what a nice day today.')
- engine.setProperty('voice', 'polish')
- engine.say('Dzień dobry, jaki ładny dzisiaj dzień.')
- engine.setProperty('voice', 'russian')
- engine.say('Доброе утро, сегодня хороший день.')
- engine.runAndWait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement