Shanzay JamilRabia Batool
Published © GPL3+

Control Laptop using keyword spotting using Edge Impulse

Learn how to create a voice control of laptop using Arduino ble 33 sense and edge impulse using keyword spotting

IntermediateProtip10 days249
Control Laptop using keyword spotting using Edge Impulse

Things used in this project

Hardware components

Arduino Nano 33 BLE Sense
Arduino Nano 33 BLE Sense
×1

Software apps and online services

Edge Impulse Studio
Edge Impulse Studio
Arduino IDE
Arduino IDE
Jupyter Notebook
Jupyter Notebook

Story

Read more

Code

Python Code

Python
Read Words from serial communication and perform actions
import serial #Serial imported for Serial communication
import time #Required to use delay functions
import pyautogui

ArduinoSerial = serial.Serial('com3',9600) #Create Serial port object called arduinoSerialData
time.sleep(2) #wait for 2 seconds for the communication to get established

while 1:
    incoming = str (ArduinoSerial.readline()) #read the serial data and print it as line
    print (incoming)
    
    if 'Play' in in coming:
        pyautogui.typewrite(['space'], 0.2)

    if 'Stop' in incoming:
        pyautogui.typewrite(['space'], 0.2)

    if 'Backward' in incoming:
        pyautogui.hotkey('ctrl', 'left')  

    if 'Forward' in incoming:
        pyautogui.hotkey('ctrl', 'right') 

    if 'Vup' in incoming:
        pyautogui.hotkey('ctrl', 'down')
        
    if 'Vdown' in incoming:
        pyautogui.hotkey('ctrl', 'up')

    if 'Next' in incoming:
        pyautogui.hotkey('n')
 
    incoming = "";

Building a Voice Command control of Screen using Keyword Spotting

Github link for all code files

Credits

Shanzay Jamil
1 project • 0 followers
Rabia Batool
0 projects • 0 followers
Thanks to Rabia Batool.

Comments