https://github.com/zoomoid/waveman
Generates visual audio representation with python + soundfile + libcairo
https://github.com/zoomoid/waveman
Last synced: 12 months ago
JSON representation
Generates visual audio representation with python + soundfile + libcairo
- Host: GitHub
- URL: https://github.com/zoomoid/waveman
- Owner: zoomoid
- Created: 2019-08-30T14:54:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T12:52:03.000Z (about 2 years ago)
- Last Synced: 2025-03-27T04:33:31.517Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 125 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wave-man

Generates visualizations of audio files like SoundCloud with some Python magic.
Requires `libsndfile` & `ffmpeg` to read audio formats other than pure waves if used in host mode.
Otherwise just run the docker image and mount the audio file as volume.
```bash
usage: main.py [-h] --input INPUT [--steps STEPS] [--totalwidth TOTALWIDTH]
[--stepwidth STEPWIDTH] [--height HEIGHT] [--output OUTPUT]
[--color COLOR] [--rounded ROUNDED] [--mode {avg,max}]
[--align {bottom,center}]
Creates cool-lookin audio waveform visualisations to use as assets in players
and videos.
optional arguments:
-h, --help show this help message and exit
--input INPUT Input file path. Required
--steps STEPS The total number of steps done. [Default 200]
--totalwidth TOTALWIDTH
The total width of the image. [Default 2000]
--stepwidth STEPWIDTH
Width of each step. Can derive the total width by
providing --steps and --stepwidth. [Default 10]
--height HEIGHT The total height of the image. [Default 128]
--output OUTPUT Output file path. [Default $input]
--color COLOR The fill color for the bars. [Default 'black']
--rounded ROUNDED Rounded corner radius. [Default 0]
--mode {avg,max,rounded_avg} Sample visualization mode. Either 'avg', 'rounded_avg', or 'max'
[Default 'avg']
--align {bottom,center}
Vertical bar alignment. Either 'center' or 'bottom'
[Default 'bottom']
```
## Docker Mode
Build the Docker image from the provided Dockerfile and run it like this
```bash
# Build the Docker image yourself OR
$ docker build -t wave-man:latest src/
# Pull the official image from the Github Docker Registry
$ docker pull docker.pkg.github.com/occloxium/wave-man/wave-man:latest
# Run wave-man inside the image
$ docker run -ti -v :/app/files python3 main.py --input [ARGS...]
```
## HTTP Server
Wave-Man is available as a standalone http backend that waits for an mp3 file to be submitted and returns SVG code according to the config.json file
Note that the URI has to be local, i.e., come from for example a mounted volume when running as a
container or a valid filename for any mp3 located in ./files.
```
HTTP/1.1 POST /wavify {"uri": ""}
```