Help us shape the future of Go! Take the 2026 Go Developer Survey

beeper

package module
v0.0.0-...-459f300 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2020 License: BSD-2-Clause Imports: 6 Imported by: 0

README

beeper

beeper - play sound via PC speaker

GoDoc GoDev Go Walker GolangCI GoReport Codacy Badge License Build status Build Status Dependencies Free Gluten Free DepShield Badge Stars

Installation
go get github.com/biter777/beeper
Usage
func main() {
	b, _ := beeper.NewBeeper()
	b.Beep(5000, 100*time.Millisecond)   // beep sound via PC speaker, 5000 hz, 100 ms
	b.BeepItems(beeper.StarWars(), 1)    // play StarWars melody via PC speaker with melody speed = 1 :)
	b.Close()
}
Contributing

Welcome pull requests, bug fixes and issue reports.
Before proposing a change, please discuss it first by raising an issue.
Star us. Give us a star, please, if it's not against your religion :)

Documentation

Overview

Package beeper - play sound via PC speaker

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimpleBeep

func SimpleBeep() error

SimpleBeep - just a simple beep via stdout

Types

type BeepItem

type BeepItem struct {
	Freq     int
	Duration time.Duration
	Pause    time.Duration // Pause after sound off, used in BeepItems()
}

BeepItem - Beep Item (freq and duration)

func StarWars

func StarWars() []BeepItem

StarWars - StarWars

func StarWarsShortest

func StarWarsShortest() []BeepItem

StarWarsShortest - StarWarsShortest

type Beeper

type Beeper interface {
	Beep(freq int, duration time.Duration) error
	BeepItem(item *BeepItem) error
	BeepItems(items []BeepItem, speed float64) error
	Close() error
}

Beeper - PC-speaker beeper

func NewBeeper

func NewBeeper() (Beeper, error)

NewBeeper - NewBeeper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL