Video:-
Source_Code :-
Youtube Controls like Play, Pause, Mute, Volume up and down
elif "pause" in query:
pyautogui.press("k")
speak("video paused")
elif "play" in query:
pyautogui.press("k")
speak("video played")
elif "mute" in query:
pyautogui.press("m")
speak("video muted")
elif "volume up" in query:
from keyboard import volumeup
speak("Turning volume up,sir")
volumeup()
elif "volume down" in query:
from keyboard import volumedown
speak("Turning volume down, sir")
volumedown()
Now make a new file & name it keyboard.py and paste the following code:-
from pynput.keyboard import Key,Controller
from time import sleep
keyboard = Controller()
def volumeup():
for i in range(5):
keyboard.press(Key.media_volume_up)
keyboard.release(Key.media_volume_up)
sleep(0.1)
def volumedown():
for i in range(5):
keyboard.press(Key.media_volume_down)
keyboard.release(Key.media_volume_down)
sleep(0.1)
No comments:
Post a Comment