Skip to content

Bierce02/Voice.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

#Voice.py #A code that used to allow you to scroll down or up with your voice

import speech_recognition as sr import pyautogui

while 0 < 10: speed = 120 sleepTime = 1

r = sr.Recognizer()



with sr.Microphone() as source:
    print("say Down or up")
    audio = r.listen(source)

    try:
        text = r.recognize_google(audio)
        print("you said",format(text))
    except:
        print("sorry I did not understand you")


if text .__contains__("down"):

    for i in range (10):
        pyautogui.scroll(int(-speed))

        pyautogui.sleep(int(-sleepTime))



if text .__contains__("up"):
    for i in range (10):
        pyautogui.scroll(int(speed))

        pyautogui.scroll(int(sleepTime))



if text .__contains__("pause"):
    pyautogui.scroll(int(speed-speed))

input()

About

A code that used to allow you to scroll down or up with your voice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published