audio

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadNotificationSound

func DownloadNotificationSound(ctx context.Context, url, filename string) error

DownloadNotificationSound downloads a free notification sound from the internet

func GetFreeNotificationSounds

func GetFreeNotificationSounds() map[string]string

GetFreeNotificationSounds returns a list of URLs for free notification sounds

Types

type NotificationSound

type NotificationSound struct {
	SampleRate int
	Duration   time.Duration
	Frequency  float64
	Volume     float64
}

NotificationSound represents a notification sound generator

func NewNotificationSound

func NewNotificationSound() *NotificationSound

NewNotificationSound creates a new notification sound generator with default values

func (*NotificationSound) GenerateBeep

func (ns *NotificationSound) GenerateBeep() ([]byte, error)

GenerateBeep generates a simple sine wave beep as WAV data

func (*NotificationSound) SaveToFile

func (ns *NotificationSound) SaveToFile(filename string) error

SaveToFile saves the generated beep to a WAV file

Jump to

Keyboard shortcuts

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