Skip to content

Instantly share code, notes, and snippets.

@4rshdeep
Created February 27, 2018 12:26
Show Gist options
  • Save 4rshdeep/859a86927f652daaf78814e4aa7f856a to your computer and use it in GitHub Desktop.
Save 4rshdeep/859a86927f652daaf78814e4aa7f856a to your computer and use it in GitHub Desktop.
#https://pyttsx3.readthedocs.io/en/latest/engine.html#examples
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('voice', 'punjabi')
rate = engine.getProperty('rate')
print(rate)
engine.setProperty('rate', rate-100)
engine.say('ਸੋ ਦਰੁ ਤੇਰਾ ਕੇਹਾ ਸੋ ਘਰੁ ਕੇਹਾ ਜਿਤੁ ਬਹਿ, ਸਰਬ ਸਮਾਲੇ ॥ ਵਾਜੇ ਤੇਰੇ ਨਾਦ ਅਨੇਕ, ਅਸੰਖਾ ਕੇਤੇ ਤੇਰੇ ਵਾਵਣਹਾਰੇ ॥ ਕੇਤੇ ਤੇਰੇ, ਰਾਗ ਪਰੀ ਸਿਉ ਕਹੀਅਹਿ ਕੇਤੇ ਤੇਰੇ ਗਾਵਣਹਾਰੇ ')
engine.runAndWait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment