tones

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ETSIDial    = []Tone{{Freq: []Hz{425}}}
	ETSIRinging = []Tone{{Freq: []Hz{425}, Dur: time.Second, Silence: 4 * time.Second}}
	ETSIBusy    = []Tone{{Freq: []Hz{425}, Dur: time.Second / 2, Silence: time.Second / 2}}
)

Functions

func Generate

func Generate(buf media.PCM16Sample, ts, dur time.Duration, amp int16, freq []Hz) time.Duration

func Play

func Play(ctx context.Context, audio media.Writer[media.PCM16Sample], vol int16, tones []Tone) error

Play specified audio tones in a loop until the context is cancelled.

Types

type Hz

type Hz uint32

type Tone

type Tone struct {
	Freq    []Hz
	Dur     time.Duration
	Silence time.Duration
}

Jump to

Keyboard shortcuts

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