This project provides a tool to generate binaural beats and mix them with a video file. It offers both a Command-Line Interface (CLI) and a web-based interface using Streamlit.
Ensure you have the following installed:
- Python 3.x
- FFMPEG
- Required Python packages (listed in
requirements.txt
)
- Clone the repository.
- Navigate to the project directory.
- Install the required Python packages:
pip install -r requirements.txt
Before running the program, you need to prepare your video file as follows:
-
Create or download a video that you intend to use with the binaural beats.
-
Edit the video using a video editing tool such as
kdenlive
on Linux or a Windows equivalent to achieve the desired length and content. -
Take note of the EXACT time of the video's duration after editing.
-
Convert this duration to milliseconds (e.g., a video of 2 minutes and 30 seconds has a duration of 150,000 milliseconds).
-
To calculate the number of milliseconds in 30 minutes:
Convert minutes to seconds: 30 minutes×60 seconds/minute=1800 seconds 30minutes×60seconds/minute=1800seconds When inputting the value into the program omit the commas
-
When running the program, you must input this value as the project duration. Failure to follow these steps will result in errors during execution.
-
** Ensure the video file is in MP4 format**.
- Open a terminal and navigate to the project directory.
- Run the program:
python main.py
- Select the CLI mode by entering
1
. - Follow the prompts to generate binaural beats and mix them with the video file.
- Open a terminal and navigate to the project directory.
- Run the program:
python main.py
- Select the Streamlit mode by entering
2
. - A web browser will open with the Streamlit interface.
- Configure the parameters in the sidebar:
- Sample Rate (Hz)
- Duration (milliseconds) (Ensure this matches the video duration)
- Number of Frequency Transitions
- Frequencies for each transition
- Binaural Volume
- Upload an MP4 video file
- Output File Name
- Click "Generate Binaural Beats" to create the binaural beats audio file.
- Click "Mix with Video" to mix the generated binaural beats with the uploaded video file.
main.py
: Entry point for the application. Allows the user to choose between CLI and Streamlit interfaces.streamlit_app.py
: Contains the Streamlit web interface logic.BinauralBeatGenerator.py
: Functions to generate binaural beats.BinauralBeatMixer.py
: Class to mix binaural beats with a video file.variables.py
: Contains theVariables
class to manage configuration and user inputs.requirements.txt
: Lists the required Python packages.
- If you encounter issues with FFMPEG, ensure it is correctly installed and accessible from the command line.
- Ensure all required Python packages are installed by running
pip install -r requirements.txt
.
This project is licensed under the MIT License. See the LICENSE file for details.