Skip to content

Instantly share code, notes, and snippets.

View psavarmattas's full-sized avatar

Puranjay Savar Mattas psavarmattas

View GitHub Profile
psavarmattas /
Created January 28, 2021 05:47
Text to Speech & Listener for Virtual Assistants in Python
import speech_recognition as sr
import pyttsx3
import datetime
listener = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
rate = engine.getProperty('rate')
engine.setProperty('rate', 150)
psavarmattas /
Last active January 28, 2021 05:42
News Text to Speech in Python
import pyttsx3
import requests
import json
import time
url = (''
'country = in&'
'apiKey =')