2019-2 CNU Econovation ML Project (Team JitterBug)
SnapPoint is a Python program that uses machine learning to recognize finger snaps and control PowerPoint presentations.
This program listens to the surrounding sounds, detects snaps, and performs the desired action using PyAutoGUI.
To run SnapPoint, you'll need the following Python libraries:
- Librosa: for extracting features from audio data
- PyAudio: for continuous audio input
- PyAutoGUI: for controlling external programs (e.g., PowerPoint)
- TensorFlow and Keras: for machine learning
You can install these dependencies using pip:
pip install librosa pyaudio pyautogui tensorflow keras
- Ensure that you have all the required dependencies installed.
- Place the pre-trained model (
ver_1.1.h5
) in the same directory as the script. - Run the script with
python snap_point.py
(or replacesnap_point.py
with the name of the script file). - The program will start listening to the surrounding sounds and detecting snaps. Once a snap is detected, it will perform the desired action in the PowerPoint presentation.
The main components of the code include:
- Loading the pre-trained machine learning model.
- Setting up an audio stream using PyAudio to listen to the surrounding sounds.
- Preprocessing the audio data using the Librosa library and the MFCC algorithm.
- Feeding the preprocessed data into the model and detecting snaps.
- Performing the desired action using PyAutoGUI when a snap is detected.
If you wish to customize the script or train your model, you may need to adjust some of the parameters, such as CHANNELS
, RATE
, FRAMES_PER_BUFFER
, N_FFT
, SCREEN_WIDTH
, and ENERGY_THRESHOLD
. Be sure to adjust these values according to your specific requirements and the capabilities of your system.
If you encounter issues with audio input or output, check your system's audio settings and ensure that the correct audio devices are selected. You may also need to adjust the FRAMES_PER_BUFFER
and RATE
parameters to match your audio device's capabilities.
Note: This program has been tested with Python 3.7+. If you are using an older version of Python, you may encounter compatibility issues.