This Python application allows users to execute voice commands to retrieve the current time or date using speech recognition. It utilizes the speech_recognition library for capturing audio input and interpreting commands.
- Voice Command Recognition: Users can speak commands to get the current time or date.
- Colorful Console Output: Utilizes the
coloramalibrary for colorful terminal output. - Environment Configuration: Loads environment variables from a
.envfile usingpython-dotenv.
Make sure you have Python installed on your machine. You can create a requirements.txt file with the following contents:
colorama==0.4.6
dotenv==0.9.9
PyAudio==0.2.14
python-dotenv==1.1.1
pyttsx3==2.98
SpeechRecognition==3.14.3
-
Clone the repository:
git clone https://github.com/xycertbsi/LongBowSpeech.git cd LongBowSpeech -
Install the required packages:
on linux:
pip install -r requirements.txt
on windows:
py -m pip install -r requirements.txt
on macos:
no idea, i not use macos sry :(
-
Create a
.envfile in the root directory with the following content:command_require=True command=Jason ListingLang=enReplace
Jasonwith the command prefix you want to use (e.g., "Hey Assistant").
-
Run the application:
python main.py
-
Speak the command "time" to get the current time or "date" to get the current date.
- The application continuously listens for voice input and recognizes speech using Google’s speech recognition service.
- If the recognized command matches the expected commands ("time" or "date"), the corresponding function is executed.
- Color-coded messages are displayed to indicate success, warnings, and errors.
Contributions are welcome! Feel free to submit a pull request or open an issue for any feature requests or bugs.
- Colorama for terminal color output.
- python-dotenv for loading environment variables.
- SpeechRecognition for speech recognition capabilities.