Magic Voice Switch is a project inspired by a popular Instagram video where magic words like "開damn" and "關damn" are used to control lights. Although the video was proven to involve manual control, this project aims to bring the idea to life by using voice commands to control lights.
The project supports two modes:
librosa
numpy
PyAudio
SpeechRecognition
openai
tensorflow
python-dotenv
venv
for MacOSMac should brew install portaudio
at first to install PyAudio
.
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ deactivate
$ rm -rf venv # remove the venv
venv
for Windows$ pip install virtualenv
$ virtualenv venv
$ venv\Scripts\activate
$ pip install -r requirements.txt
$ deactivate
$ rmdir /s venv # remove the venv
Run the following command to start the voice recognition loop:
python main.py
You will be prompted to choose the mode: