github.com/splace/sounds/examples/DTMFmaker

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


Install
go get github.com/splace/sounds/examples/DTMFmaker

Documentation

sounds

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

Status: (Beta :- stabilising API)

Overview: (see godoc reference below)

Installation:

 go get github.com/splace/sounds   

Example: play a note. ("aplay" command, or something like it, doesn't seem to exist on windows.)

package main

import (
    "io"
    "os/exec"
    "time"
)

import . "github.com/splace/sounds"

func play(s Sound) {
    cmd := exec.Command("aplay")
    out, in := io.Pipe()
    go func() {
        Encode(in, s, 44100,2)
        in.Close()
    }()
    cmd.Stdin=out 
    err := cmd.Run()
    if err != nil {
        panic(err)
    }
}

func main(){
    play(NewSound(NewTone(time.Second/440, 1),time.Second))
}

Example: saved Sound of a tune with electronic organ sampled notes.

twinkle twinkle little star

GoDoc