milkbucket/README.md

39 lines
1.6 KiB
Markdown
Raw Normal View History

2024-08-25 02:24:09 +00:00
# milkbucket
2024-09-03 02:03:17 +00:00
milkbucket is an audio visualizer. It uses
[Milkdrop](https://www.geisswerks.com/milkdrop/) preset files to generate
visualizations from standard input.
2024-08-25 02:24:09 +00:00
2024-08-26 02:03:57 +00:00
## Build
milkbucket depends on the
[projectM](https://github.com/projectM-visualizer/projectm) library. To run
milkbucket, you'll need to install this library either by building it yourself,
or installing one of the builds from
[here](https://github.com/projectM-visualizer/projectm/actions). (If you've
never done this before, you'll want to download one of the "shared" artifacts
for your system. Then, copy the contents of the artifact's `include` folder to
`/usr/local/include` and the contents of the `lib` folder to `/usr/local/lib`.)
After installing projectM, build milkbucket with `go build`.
## Usage
milkbucket reads a PCM stream from standard input to generate visualizations.
If you have an audio file and a preset in mind, you can use `ffmpeg` to
generate the PCM stream, then pipe to milkbucket, like so:
```
ffmpeg -i $audio -ar 44100 -f s16le - | ./milkbucket -p $preset
```
2024-09-03 02:03:17 +00:00
Note that neither of these commands will output any audio! If you want to hear
the audio at the same time (and assuming your machine uses pipewire), run:
2024-08-25 02:24:09 +00:00
```
2024-08-25 23:57:34 +00:00
ffmpeg -i $audio -ar 44100 -f s16le - | tee >(pw-play --rate=44100 --format=s16 -) | ./milkbucket -p $preset
2024-08-25 02:24:09 +00:00
```
2024-09-03 02:03:17 +00:00
(If you don't use pipewire try using `aplay` instead of `pw-play`, or some
other command for playing PCM streams.)
2024-08-26 02:03:57 +00:00
2024-09-03 02:03:17 +00:00
You can also generate a visualization from your system sound. Assuming pipewire
again, and that you have audio coming from Firefox, run:
2024-08-26 02:03:57 +00:00
```
pw-record --target Firefox - | ./milkbucket -p $preset
```