AudioSpectraCLI is a tool that provides real-time FFT visualization of audio spectra. It captures audio input from the microphone and displays the corresponding frequency spectrum directly, allowing users to monitor and analyze audio signals.
Project description
_ _ _ ____ _ ____ _ ___
/ \ _ _ __| (_) ___ / ___| _ __ ___ ___| |_ _ __ __ _ / ___| | |_ _|
/ _ \| | | |/ _` | |/ _ \ ____\___ \| '_ \ / _ \/ __| __| '__/ _` | | | | | |
/ ___ \ |_| | (_| | | (_) |_____|__) | |_) | __/ (__| |_| | | (_| | |___| |___ | |
/_/ \_\__,_|\__,_|_|\___/ |____/| .__/ \___|\___|\__|_| \__,_|\____|_____|___|
|_|
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 and dynamic interface for users to start the visualization and exit the program.
Notable point : From v4.0, I have implemented a whole new code using PyQt5, which you will find evident here in the new main default code - 'main.py' and the 'test.py' case supporting that.
The 'main-old.py', which is the code for the main file for v3.2, and the 'test-old.py' case supporting that, is DEPRECATED.
Current Features (with respect to 4.1.0)
- Real-time visualization of Fast Fourier Transform (FFT) spectrum of audio input.
- Live VS Code Extension support.
- Support for adjusting parameters such as duration, sampling rate, and block size.
- Seamless integration with SoundDevice for audio input capture.
- Customizable Frequency Range: Allow users to specify the frequency range to display in the spectrum.
- Color Customization: Provide options for users to customize the colors used in the spectrum visualization.
- Added PyQt5 modules and a Gaussian filter that enables user input for Duration (in seconds), Sampling Rate (in Hz), Block Size, and also smoothens the output.
- Might need to keep in mind that the Gaussian filter is too strong and it won't recognise any noise and display it's spectra. Only actual input through mic such as conversations and music are displayed which can be categorised as real inputs or audio, and of course in real time.
- Much more dynamic and user-controlled interface.
Packaging
Audio-SpectraCLI/
├── .gitignore
├── CODE_OF_CONDUCT.md
├── Contributing.md
├── Dockerfile
├── LICENSE
├── Readme.md
├── requirements.txt
├── setup.cfg
├── setup.py
├── .github/
│ └── workflows/
│ ├── docker-publish.yml
│ ├── label.yml
│ └── python-publish.yml
├── Audio_SpectraCLI/
│ ├── main-old.py
│ ├── main.py
│ └── __init__.py
└── tests/
├── ├── test-old.py
├── └── test.py
└── audiospectra-cli/
├── assets
├── dist
├── src/
│ ├── test
│ ├── extension.test.ts
│ └── extension.ts
├── audio-spectracli-extension-v.vsix
├── CHANGELOG.md
├── ebuild.js
├── eslint.config.mjs
├── package.json
├── package-lock.json
├── README.md
├── sample.py
└── tsconfig.json
Installation Methods : (Now Extension available)
Installation & Usage (Using VSCode Extensions - Marketplace)
How to Use the Audio-SpectraCLI Extension
Follow these steps to use the Audio-SpectraCLI extension in Visual Studio Code:
-
Open Visual Studio Code
- Launch VS Code on your computer (macOS, Windows, or Linux).
-
Install the Audio-SpectraCLI Extension
- Go to the Extensions sidebar by clicking on the Extensions icon in the Activity Bar (or press
Ctrl+Shift+X
on Windows/Linux orCmd+Shift+X
on macOS). - Search for "Audio-SpectraCLI" in the Extensions Marketplace.
- Click Install next to the Audio-SpectraCLI extension.
- Go to the Extensions sidebar by clicking on the Extensions icon in the Activity Bar (or press
-
Activate the Extension
- After installation, open the Command Palette by pressing
F1
orCtrl+Shift+P
on Windows/Linux orCmd+Shift+P
on macOS. - Type
>Audio-SpectraCLI: Add Sample Code
or>Audio-SpectraCLI: View Status
. - Select either command to activate and use the extension.
- After installation, open the Command Palette by pressing
-
Using the Commands
- Add Sample Code: Inserts sample code for Audio-SpectraCLI into the current editor window.
- Open any Python file or create a new one.
- Run the command
Audio-SpectraCLI: Add Sample Code
from the Command Palette. - The sample code should appear in the editor.
- View Extension Status: Displays the current status of Audio-SpectraCLI.
- Run the command
Audio-SpectraCLI: View Status
from the Command Palette. - You’ll see a notification indicating that Audio-SpectraCLI is ready to use.
- Run the command
- Add Sample Code: Inserts sample code for Audio-SpectraCLI into the current editor window.
-
Verify the Extension
- Ensure that the Audio-SpectraCLI commands work as expected by following the steps above.
- You should see notifications for the status and sample code added in the editor.
-
Customize as Needed
- You can modify the inserted code or use the extension as a reference for developing your own custom scripts with Audio-SpectraCLI.
Note: If you encounter issues, check the extension's README or reach out to contact@adityaseth.in support for troubleshooting.
Enjoy using Audio-SpectraCLI in VS 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. Also, the user can modify (wrt v4.1.0) the Duration (in seconds), Sampling Rate (in Hz), and Block Size.
Installation & Usage (Using PIP on Windows)
- Install using pip (Use pip3 instead, if pip doesn't work.)
pip install Audio-SpectraCLI
- Import and use modules
- Create a Python file.
- You can use Example.py as a reference or use the following code :
from Audio_SpectraCLI import AudioSpectrumVisualizer
from PyQt5.QtWidgets import QApplication
# Creating an instance of AudioSpectrumVisualizer with custom parameters
app = QApplication([])
audio_visualizer = AudioSpectrumVisualizer(
duration=5, fs=22050, block_size=1024, frequency_range=(1000, 5000), color='red')
# Starting the audio spectrum visualization
audio_visualizer.show()
app.exec_()
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. Also, the user can modify (wrt v4.1.0) the Duration (in seconds), Sampling Rate (in Hz), and Block Size.
Installation & Usage (Using Homebrew and pip on MacOS)
- Install using pip (Use pip3 instead, if pip doesn't work.)
brew install pyaudio
pip install Audio-SpectraCLI
- Import and use modules
- Create a Python file.
- You can use Example.py as a reference or use the following code :
from Audio_SpectraCLI import AudioSpectrumVisualizer
from PyQt5.QtWidgets import QApplication
# Creating an instance of AudioSpectrumVisualizer with custom parameters
app = QApplication([])
audio_visualizer = AudioSpectrumVisualizer(
duration=5, fs=22050, block_size=1024, frequency_range=(1000, 5000), color='red')
# Starting the audio spectrum visualization
audio_visualizer.show()
app.exec_()
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. Also, the user can modify (wrt v4.1.0) the Duration (in seconds), Sampling Rate (in Hz), and Block Size.
Examining & Usage (Using Docker)
- Prerequisites You should have docker installed on your machine. You can download and install Docker from here.
- Pulling the Docker Image
You can pull the pre-built Docker image from Docker Hub using the following command:
docker pull adityaseth777/audio-spectracli
- Viewing Files Inside the Docker Container For seeing the files inside the Docker container for debugging purposes, you can run an interactive shell session:
docker run --rm -it --entrypoint /bin/bash audio-spectracli
- Use the 'ls' command to view the files and get a proper understanding of the file structure :
ls
- You can use Example.py as a reference or use the following code :
from Audio_SpectraCLI import AudioSpectrumVisualizer
from PyQt5.QtWidgets import QApplication
# Creating an instance of AudioSpectrumVisualizer with custom parameters
app = QApplication([])
audio_visualizer = AudioSpectrumVisualizer(
duration=5, fs=22050, block_size=1024, frequency_range=(1000, 5000), color='red')
# Starting the audio spectrum visualization
audio_visualizer.show()
app.exec_()
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. Also, the user can modify (wrt v4.1.0) the Duration (in seconds), Sampling Rate (in Hz), and Block Size.
Building the Docker Image Locally
If you prefer to build the Docker image locally, follow these steps:
- Clone the repository :
git clone https://github.com/AdityaSeth777/Audio-SpectraCLI.git
cd Audio-SpectraCLI
- Build the Docker image:
docker build -t audio-spectracli .
- Viewing Files Inside the Docker Container For seeing the files inside the Docker container for debugging purposes, you can run an interactive shell session:
docker run --rm -it --entrypoint /bin/bash audio-spectracli
- Use the 'ls' command to view the files and get a proper understanding of the file structure :
ls
- You can use Example.py as a reference or use the following code :
from Audio_SpectraCLI import AudioSpectrumVisualizer
from PyQt5.QtWidgets import QApplication
# Creating an instance of AudioSpectrumVisualizer with custom parameters
app = QApplication([])
audio_visualizer = AudioSpectrumVisualizer(
duration=5, fs=22050, block_size=1024, frequency_range=(1000, 5000), color='red')
# Starting the audio spectrum visualization
audio_visualizer.show()
app.exec_()
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. Also, the user can modify (wrt v4.1.0) the Duration (in seconds), Sampling Rate (in Hz), and Block Size.
Upcoming Features
- Save and Export: Implement functionality to save the generated spectrum as an image file or export data for further analysis.
- CLI endpoints.
- Option to choose between CLI/GUI.
For contributing
Check the Contributing page.
License
What next?
I will be improving this project.
Where to contact ?
Contact: contact@adityaseth.in
🙋♂️ Support
💙 If you like this project, give it a ⭐ and share it with friends!
Made with and
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Audio_SpectraCLI-4.1.0.tar.gz
.
File metadata
- Download URL: Audio_SpectraCLI-4.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d5ee67ce7470fd1dcaa8913efb180ffc33ac95eea792b4bdeb00295beaa9d45 |
|
MD5 | ad74d987d852ffd04285fc2b71079ba4 |
|
BLAKE2b-256 | eb0cea274345c3c69d260814d61ac5291e923959abc010a120bfadb88d6f3c27 |
File details
Details for the file Audio_SpectraCLI-4.1.0-py3-none-any.whl
.
File metadata
- Download URL: Audio_SpectraCLI-4.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92c48547ac9dfbafb8cb18dfb7cfa15533febcd82a3892a5e6a4b16dc8a44ab |
|
MD5 | e4f322fbb742c9a94dae7e66efc5abc0 |
|
BLAKE2b-256 | 2a1fb19267264f4df23adda5322cd6cf6aa74e3232a17371b190e62764e8d2e2 |