Skip to content

Instantly share code, notes, and snippets.

View psavarmattas's full-sized avatar
:electron:

Puranjay Savar Mattas psavarmattas

:electron:
View GitHub Profile
@psavarmattas
psavarmattas / news.py
Last active January 28, 2021 05:42
News Text to Speech in Python
import pyttsx3
import requests
import json
import time
url = ('https://newsapi.org/v2/top-headlines?'
'country = in&'
'apiKey =')
url += 'YOUR_API_KEY_HERE'
@psavarmattas
psavarmattas / Virtual_Assistant.py
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)