Skip to content
/ sounds Public

Go language generation, manipulation, storage and streaming of sounds. Uses Signals package;

Notifications You must be signed in to change notification settings

splace/sounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

43b73b5 · Jul 25, 2018
Jul 30, 2016
Jul 25, 2018
Jul 5, 2016
Jul 25, 2018
Oct 31, 2017
Oct 31, 2017
Jun 27, 2016
Jul 15, 2016
Oct 31, 2017
Jul 30, 2016
Jul 15, 2016
Jul 5, 2016

Repository files navigation

sounds

Go language generation and manipulation of sounds, built on github.com/splace/signals package.

Status: (Beta :- stabilising API)

Overview/docs: GoDoc uses Signals: GoDoc

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.

twinkle twinkle little star

About

Go language generation, manipulation, storage and streaming of sounds. Uses Signals package;

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages