diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 67defc1..0000000 --- a/.gitignore +++ /dev/null @@ -1,56 +0,0 @@ -# This .gitignore file should be placed at the root of your Unity project directory -# -# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore -# -[Ll]ibrary/ -[Tt]emp/ -[Oo]bj/ -[Bb]uild/ -[Bb]uilds/ -[Ll]ogs/ -[Mm]emoryCaptures/ - -# Never ignore Asset meta data -!/[Aa]ssets/**/*.meta - -# Uncomment this line if you wish to ignore the asset store tools plugin -# /[Aa]ssets/AssetStoreTools* - -# Autogenerated Jetbrains Rider plugin -[Aa]ssets/Plugins/Editor/JetBrains* - -# Visual Studio cache directory -.vs/ - -# Gradle cache directory -.gradle/ - -# Autogenerated VS/MD/Consulo solution and project files -ExportedObj/ -.consulo/ -*.csproj -*.unityproj -*.sln -*.suo -*.tmp -*.user -*.userprefs -*.pidb -*.booproj -*.svd -*.pdb -*.mdb -*.opendb -*.VC.db - -# Unity3D generated meta files -*.pidb.meta -*.pdb.meta -*.mdb.meta - -# Unity3D generated file on crash reports -sysinfo.txt - -# Builds -*.apk -*.unitypackage diff --git a/meditation.py b/meditation.py new file mode 100644 index 0000000..fe957c3 --- /dev/null +++ b/meditation.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.common.keys import Keys + +import speech_recognition as sr +from playsound import playsound +from gtts import gTTS + +import time + +GOOGLE_CLOUD_SPEECH_CREDENTIALS = +def listener(): + r = sr.Recognizer() + with sr.Microphone() as source: + print("listening") + audio = r.listen(source) + try: + print("speech detected") + speech = r.recognize_google_cloud(audio, credentials_json=GOOGLE_CLOUD_SPEECH_CREDENTIALS) + return speech + except sr.UnknownValueError: + print("Google Cloud Speech could not understand audio") + except sr.RequestError as e: + print("Could not request results from Google Cloud Speech service; {0}".format(e)) + +searchQuery = listener() +browser = webdriver.Chrome(r"C:\Users\Bhou5\Downloads\chromedriver_win32\chromedriver.exe") +browser.get('https://www.youtube.com') +browser.find_element_by_id("content").click() +browser.find_element_by_xpath(r'//*[@id="search"]').send_keys(searchQuery + Keys.ENTER) +time.sleep(1) +browser.find_element_by_xpath('//*[@id="title-wrapper"]').click()