-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from AdityaSeth777/dev-v3.2
Added Docker Support.
- Loading branch information
Showing
6 changed files
with
151 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Change to your main branch name | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/audio-spectra-cli:latest | ||
|
||
- name: Logout from Docker Hub | ||
run: docker logout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Greetings | ||
|
||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GREETINGS_TOKEN }} | ||
issue-message: "Greetings and Thank you for submitting the issue ! This message is automated, in case you are wondering. I will get back to you on this." | ||
pr-message: "Congratulations on submitting your PR ! It will be merged if it passes the requirements. Thanks." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.9-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install any needed dependencies specified in requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Command to run your module | ||
CMD ["python", "-m", "Audio_SpectraCLI.main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
Audio Spectrum Visualization is a Python project that visualizes real-time audio input as a spectrum using Fast Fourier Transform (FFT). It provides an interactive CLI interface for users to start the visualization and exit the program. | ||
|
||
## Current Features (with respect to 3.1) | ||
## Current Features (with respect to 3.2) | ||
|
||
- Real-time visualization of Fast Fourier Transform (FFT) spectrum of audio input. | ||
- Support for adjusting parameters such as duration, sampling rate, and block size. | ||
|
@@ -24,6 +24,7 @@ Audio-SpectraCLI/ | |
│ CODE_OF_CONDUCT.md | ||
│ Contributing.md | ||
│ Dockerfile | ||
│ LICENSE | ||
│ Readme.md | ||
│ requirements.txt | ||
|
@@ -42,7 +43,13 @@ Audio-SpectraCLI/ | |
main.py | ||
``` | ||
|
||
## Installation & Usage | ||
## Installation Types: | ||
|
||
├───Using PIP <br> | ||
├───Using Docker <br> | ||
└───Using Docker locally <br> | ||
|
||
## Installation & Usage (Using PIP) | ||
|
||
1. Install using pip | ||
|
||
|
@@ -53,7 +60,43 @@ pip install Audio-SpectraCLI | |
2. Import and use modules | ||
|
||
- Create a Python file. | ||
- You can use [Example.py](https://github.com/AdityaSeth777/Audio-SpectraCLI/blob/3.1/tests/main.py) as a reference or use the following code : | ||
- You can use [Example.py](https://github.com/AdityaSeth777/Audio-SpectraCLI/blob/main/tests/main.py) as a reference or use the following code : | ||
|
||
``` | ||
from Audio_SpectraCLI import AudioSpectrumVisualizer | ||
# Creating an instance of AudioSpectrumVisualizer with custom parameters. | ||
audio_visualizer = AudioSpectrumVisualizer( | ||
duration=5, frequency_range=(50, 5000), color='red') | ||
# Starting the audio spectrum visualization | ||
audio_visualizer.start_visualization() | ||
``` | ||
|
||
Once you have activated the audio_visualizer instance, feel free to use it wherever in the program. It consists of several parameters (which gives more control to the user), so make sure to configure and add those before using it in your code. | ||
|
||
--- | ||
|
||
## Installation & Usage (Using Docker) | ||
|
||
1. Prerequisites | ||
You should have docker installed on your machine. You can download and install Docker from [here](https://www.docker.com/products/docker-desktop). | ||
2. Pulling the Docker Image | ||
|
||
You can pull the pre-built Docker image from Docker Hub using the following command: | ||
|
||
```sh | ||
docker pull adityaseth777/audio-spectra-cli | ||
``` | ||
|
||
3. Running the Docker Container | ||
To run the Docker container, use the following command: | ||
|
||
``` | ||
docker run --rm -it adityaseth777/audio-spectra-cli:latest | ||
``` | ||
|
||
4. You can use [Example.py](https://github.com/AdityaSeth777/Audio-SpectraCLI/blob/main/tests/main.py) as a reference or use the following code : | ||
|
||
``` | ||
from Audio_SpectraCLI import AudioSpectrumVisualizer | ||
|
@@ -66,10 +109,48 @@ audio_visualizer = AudioSpectrumVisualizer( | |
audio_visualizer.start_visualization() | ||
``` | ||
|
||
- Once you have activated the audio_visualizer instance, feel free to use it wherever in the program. It consists of several parameters (which gives more control to the user), so make sure to configure and add those before using it in your code. | ||
Once you have activated the audio_visualizer instance, feel free to use it wherever in the program. It consists of several parameters (which gives more control to the user), so make sure to configure and add those before using it in your code. | ||
|
||
--- | ||
|
||
## Building the Docker Image Locally | ||
|
||
If you prefer to build the Docker image locally, follow these steps: | ||
|
||
1. Clone the repository : | ||
|
||
```sh | ||
git clone https://github.com/AdityaSeth777/Audio-SpectraCLI.git | ||
cd Audio-SpectraCLI | ||
``` | ||
|
||
2. Build the Docker image: | ||
|
||
```sh | ||
docker build -t audio-spectra-cli . | ||
``` | ||
|
||
3. Run the Docker container: | ||
|
||
```sh | ||
docker run --rm -it audio-spectra-cli | ||
``` | ||
|
||
4. You can use [Example.py](https://github.com/AdityaSeth777/Audio-SpectraCLI/blob/main/tests/main.py) as a reference or use the following code : | ||
|
||
``` | ||
from Audio_SpectraCLI import AudioSpectrumVisualizer | ||
# Creating an instance of AudioSpectrumVisualizer with custom parameters. | ||
audio_visualizer = AudioSpectrumVisualizer( | ||
duration=5, frequency_range=(50, 5000), color='red') | ||
# Starting the audio spectrum visualization | ||
audio_visualizer.start_visualization() | ||
``` | ||
|
||
Once you have activated the audio_visualizer instance, feel free to use it wherever in the program. It consists of several parameters (which gives more control to the user), so make sure to configure and add those before using it in your code. | ||
|
||
## Upcoming Features | ||
|
||
- CLI endpoints. | ||
|
@@ -102,7 +183,7 @@ Contact: [[email protected]] | |
|
||
## 🙋♂️ Support | ||
|
||
💙 If you like this project, give it a ⭐ and share it with friends!<br><br> | ||
💙 If you like this project, give it a ⭐ and share it with friends!`<br><br>` | ||
[☕ Buy me a coffee](https://www.buymeacoffee.com/adityaseth) | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = Audio-SpectraCLI | ||
version = 3.1 | ||
version = 3.2 | ||
author = Aditya Seth | ||
author_email = [email protected] | ||
description = AudioSpectraCLI is a command-line tool that provides real-time FFT visualization of audio spectra. It captures audio input from the microphone and displays the corresponding frequency spectrum directly in the terminal window, allowing users to monitor and analyze audio signals without the need for graphical interfaces. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters