一个可以从音频流中生成波形图像的 Go 包。采用 MIT 许可证。
Go package capable of generating waveform images from audio streams. MIT Licensed.
This library supports any audio streams which the azul3d/engine/audio package is able to decode. At the time of writing, this includes:
An example binary called waveform is provided which show's the library's usage.
Please see cmd/waveform/README.md
for details.
Here are several example images generated using waveform. Enjoy!
Generate a waveform image, and scale it both vertically and horizontally.
$ cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -x 5 -y 2 > ~/waveform.pngApply a foreground and background color, to make things more interesting.
cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -fg=#FF3300 -bg=#0099CC -x 5 -y 2 > ~/waveform_color.pngApply an alternate foreground color, draw using a stripe pattern.
cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -fg=#FF3300 -bg=#0099CC -alt=#FF9933 -fn stripe -x 5 -y 2 > ~/waveform_stripe.pngApply an alternate foreground color, draw using a random fuzz pattern.
cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -fg=#FF3300 -bg=#0099CC -alt=#FF9933 -fn fuzz -x 5 -y 2 > ~/waveform_fuzz.pngApply a new set of colors, draw using a gradient pattern.
cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -fg=#FF0000 -bg=#00FF00 -alt=#0000FF -fn gradient -x 5 -y 2 > ~/waveform_gradient.pngApply a checkerboard color set, draw using a checkerboard pattern.
cat ~/Music/02\ -\ Peace\ Of\ Mind.flac | waveform -fg=#000000 -bg=#222222 -alt=#FFFFFF -fn checker -x 5 -y 2 > ~/waveform_checker.png暂无开放 Issues,或尚未同步最近议题。