Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diamondgotcat/spaudio
This project is a Python-based audio simulation tool that uses Pyroomacoustics and Pydub to create realistic room acoustics effects. It allows users to load an audio file, simulate the sound in a 3D room environment, and either save the processed audio to a file or play it back directly.
https://github.com/diamondgotcat/spaudio
audio audio-effect audio-player audio-processing
Last synced: 28 days ago
JSON representation
This project is a Python-based audio simulation tool that uses Pyroomacoustics and Pydub to create realistic room acoustics effects. It allows users to load an audio file, simulate the sound in a 3D room environment, and either save the processed audio to a file or play it back directly.
- Host: GitHub
- URL: https://github.com/diamondgotcat/spaudio
- Owner: DiamondGotCat
- License: mit
- Created: 2024-06-20T21:10:15.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-30T03:58:15.000Z (2 months ago)
- Last Synced: 2024-10-30T06:27:02.368Z (2 months ago)
- Topics: audio, audio-effect, audio-player, audio-processing
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spaudio: Spatial Audio Simulation Tool
Spaudio is a Python application designed to simulate spatial audio effects in a virtual 3D room environment. By leveraging the power of Pyroomacoustics and Pydub, Spaudio provides users with the ability to create realistic acoustic simulations, ideal for research, audio engineering, and immersive sound design.## Features
- **Audio File Input**: Load your audio files in various formats.
- **3D Room Simulation**: Define a room with customizable dimensions and simulate how sound propagates within it.
- **Multiple Sources and Microphones**: Add multiple sound sources and microphones to capture the spatial audio effect.
- **Audio Output**: Save the simulated audio to a file or play it directly through your speakers.## About default settings
Please use headphones/earphones.### Normal mode
You can experience 3D audio to a reasonable degree while maintaining compatibility.
### Stereo mode
It gives you the experience of having a privileged seat in front of a high-quality TV, but the audio files must be stereo compatible.
## Getting Started
### Prerequisites
Before you begin, ensure you have met the following requirements:
- Python 3.x
- Pyroomacoustics
- Pydub
- ffmpeg (for Pydub)### Installation
Clone the repository and install the required packages:
```bash
git clone https://github.com/DiamondGotCat/Spaudio.git
cd spaudio
pip install -r requirements.txt
```### Usage
To run Spaudio, use the following command:
```bash
python spaudio.py [--output_file ] [--room_dim ] [--source_position ]
```- ``: Path to the input audio file.
- `--output_file `: (Optional) Path to save the output audio file.
- `--room_dim `: (Optional) Room dimensions.
- `--source_position `: (Optional) Source position.
- `--source_position `: (Optional) Source position for stereo-mode.**(Replacing spaudio.py with spaudio-stereo.py will improve the sound quality)**
### Example
**Simulate an audio file and play it back:**
```bash
python spaudio.py input.wav
```**Simulate an audio file and save the output:**
```bash
python spaudio.py input.wav --output_file output.wav
```**(Replacing spaudio.py with spaudio-stereo.py will improve the sound quality)**
## Default
![スクリーンショット 2024-06-23 21 16 58](https://github.com/DiamondGotCat/Spaudio/assets/124330624/bd20b0fc-9a7e-4f2f-9b3d-733236d6ed44)**(Square: Speaker ,Circle: Microphone)**
## Code Explanation
1. **Loading Audio**: The script loads the input audio file using Pydub and extracts the audio data and sample rate.
2. **Audio Normalization**: The audio data is normalized to ensure consistent amplitude levels.
3. **Room Configuration**: A 3D room environment is defined with specified dimensions and acoustic properties.
4. **Source and Microphone Placement**: Multiple sound sources and microphones are positioned within the room to capture the spatial audio effect.
5. **Simulation**: Pyroomacoustics simulates the sound propagation and captures the audio signals at each microphone.
6. **Output**: The simulated audio can be saved to a file or played back directly.## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- Pyroomacoustics: https://github.com/LCAV/pyroomacoustics
- Pydub: https://github.com/jiaaro/pydubEnjoy creating immersive audio experiences with Spaudio!