tones

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

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