all repos — captcha @ 5357b20fc91de2905938534e511feb7a9d2887b9

Go package captcha implements generation and verification of image and audio CAPTCHAs.

cmd/audio/main.go (view raw)

 1package main
 2
 3import (
 4	"github.com/dchest/captcha"
 5	"log"
 6	"os"
 7)
 8
 9func main() {
10	f, err := os.Create("mixed.wav")
11	if err != nil {
12		log.Fatalf("%s", err)
13	}
14	defer f.Close()
15
16	c := captcha.NewAudio([]byte{1, 2, 3, 4, 5, 6})
17	n, err := c.WriteTo(f)
18	if err != nil {
19		log.Fatalf("%s", err)
20	}
21	println("written", n)
22}