VerbalControl is a Python-based project that allows users to control system commands using voice commands. It listens for specific voice phrases and executes predefined commands based on the recognized phrases.
- Voice Command Recognition: Utilizes Google's Speech Recognition API to understand spoken commands.
- Command Execution: Executes system commands as specified in a configuration file.
- Customizable Commands: Commands and trigger phrases are configurable via text files.
- Command Logging: Logs executed commands to a file for history tracking.
- Error Handling: Includes basic error handling for speech recognition and command execution.
- Clone the repository:
git clone https://github.com/nomadsdev/verbal-control.git
- Navigate to the project directory:
cd verbal-control
- Install the required dependencies:
pip install -r requirements.txt
- Create
commands.txt
: This file should contain the voice phrases that trigger the commands. Each phrase should be on a new line.
run command
execute script
- Create
command.config
: This file should contain the system command(s) that you want to execute when a phrase is recognized.
python test.py
- Create
config.json
: This file should contain configuration settings for the project.
{
"phrases_file": "commands.txt",
"command_file": "command.config",
"language": "en-US"
}
- Run the script:
python voice_command.py
- Speak one of the phrases listed in
commands.txt
. If recognized, the corresponding command fromcommand.config
will be executed.
- Viewing Command History: The script maintains a log of executed commands in
command_log.txt
. After each command execution, the history is updated.
python voice_command.py
- "Sorry, I did not understand that.": Ensure you are speaking clearly and that the microphone is functioning correctly.
- "Error executing command:": Verify that the command in
command.config
is correct and executable in your environment. - "Error reading from file:": Check that your
commands.txt
,command.config
, andconfig.json
files are correctly formatted and present in the project directory.
speech_recognition
: For recognizing spoken commands.pyaudio
: For accessing the microphone.subprocess
: For executing system commands.
You can install these dependencies via:
pip install speech_recognition pyaudio
If you would like to contribute to VerbalControl, please fork the repository and submit a pull request. Contributions are welcome!
This project is licensed under the MIT License.
For any questions or feedback, please reach out to [email protected] or open an issue on the GitHub repository.