Go language generation and manipulation of sounds, built on github.com/splace/signals package.
Status: (Beta :- stabilising API)
Installation:
go get github.com/splace/sounds
Example: play a note.(uses linux "aplay" command.)
package main
import (
"os/exec"
"time"
)
import . "github.com/splace/sounds"
func play(s Sound) {
cmd := exec.Command("aplay","--rate=44100","--format=S16_LE")
in,err:=cmd.StdinPipe()
if err != nil {
panic(err)
}
err = cmd.Start()
if err != nil {
panic(err)
}
Encode(in, 2, 44100, s)
in.Close()
err = cmd.Wait()
if err != nil {
panic(err)
}
}
func main(){
play(NewSound(NewTone(time.Second/440, 1),time.Second/3))
}
Example: A tune with sampled notes.