Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xigh/go-waveform
Go module to generate and render waveform images from audio files
https://github.com/xigh/go-waveform
golang module render wav waveform
Last synced: about 2 months ago
JSON representation
Go module to generate and render waveform images from audio files
- Host: GitHub
- URL: https://github.com/xigh/go-waveform
- Owner: xigh
- License: mit
- Created: 2020-03-06T08:59:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T10:35:53.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T16:57:38.983Z (7 months ago)
- Topics: golang, module, render, wav, waveform
- Language: Go
- Size: 56.6 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-waveform
Go module to generate and render waveform images from audio files
Example :
![combined](combined.png)
We can zoom :
![combined2](combined2.png)
# TODO
* doc
* add range
* add segment
* add labels# Usage :
```go
import (
// ...
"github.com/xigh/go-waveform"
"github.com/xigh/go-wavreader"
)func main() {
r, err := os.Open("test-hello.wav")
if err != nil {
return err
}
defer r.Close()
w0, err := wavreader.New(r)
if err != nil {
return err
}
img := waveform.MinMax(w1, &waveform.Options{
Width: 1800,
Height: 400,
Zoom: 1.7,
Half: false,
MarginL: *margin,
MarginR: *margin,
MarginT: *margin,
MarginB: *margin,
Front: &color.NRGBA{
R: 255,
G: 128,
B: 0,
A: 150,
},
Back: &color.NRGBA{
A: 0,
},
})w, err := os.Create("test-minmax.png")
if err != nil {
return err
}
defer w.Close()err = png.Encode(w, img)
if err != nil {
return err
}
}
```