A Python-based voice command application that listens for specific phrases such as "Next Slide", "Previous Slide", "Click Mouse" and performs predefined actions. Users can customize and enable/disable commands using the JSON configuration file.
- Voice recognition powered by the
speech_recognition
library - Simulate mouse clicks or keyboard actions with
pyautogui
- Customizable commands via
config.json
- Activate or deactivate commands using a simple
enabled
flag in the configuration file - Adjustable microphone sensitivity
- Logs for debugging
- Clone this repository:
git clone https://github.com/WarmMilkCodes/NextSlide.git cd NextSlide
- Install the required dependencies:
pip install -r requirements.txt
- Ensure you have a working microphone connected to your computer.
Customize the config.json
file to define and manage commands.
Example:
{
"commands": {
"next slide": {
"enabled": true,
"action": "key_press",
"key": "right"
},
"previous slide": {
"enabled": false,
"action": "key_press",
"key": "left"
},
"click mouse": {
"enabled": true,
"action": "mouse_click",
"button": "left"
}
},
"microphone_sensitivity": 0.5
}
enabled
: Toggle the command on/off (true
orfalse
)action
: Specify the type of action (key_press
ormouse_click
)key
: Key to simulate forkey_press
actionsbutton
: Button to simulate formouse_click
actions (left
,right
, ormiddle
)microphone_sensitivity
: Adjust for ambient noise (in seconds)
-
Run the application:
python main.py
-
Speak your commands into the microphone
-
Actions will be performed based on the configuration in
config.json
Example Commands
- "Next Slide": Simulates pressing the right arrow key
- "Previous Slide": Simulates pressing the left arrow key
- "Mouse Click": Simulates a left mouse click
-
Python 3.7+
-
Libraries:
speech_recognition
pyautogui
pyaudio
-
Install dependencies with:
pip install -r requirements.txt
- Command not recognized or disabled:
- Check that the command exists in
config.json
and isenabled: true
- Ensure proper formatting and case matching in
config.json
- Check that the command exists in
- Microphone not working:
- Test your microphone with another application
- Adjust
microphone_sensitivity
inconfig.json
- Translation Issues:
- Ensure you have a stable internet connection for translation Check the recognized command in the logs for unexpected outputs
Contributions are welcome. Feel free to submit a pull request or open an issue for bugs or feature requests.