sounds

package
v1.45.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoverOptions

type DiscoverOptions struct {
	PluginRoot     string // Root directory of the plugin (for built-in sounds)
	IncludeBuiltIn bool
	IncludeSystem  bool
	MaxSystemDepth int // Max directory depth for Linux system sounds (default 5)
}

DiscoverOptions controls which sound sources to scan.

type SoundInfo

type SoundInfo struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Format      string `json:"format"`
	Source      string `json:"source"`
	Description string `json:"description"`
}

SoundInfo represents a discovered sound file.

func Discover

func Discover(opts DiscoverOptions) []SoundInfo

Discover scans for available sounds and returns them grouped by source. Built-in sounds are listed first, then system sounds.

func FindByName

func FindByName(name string, available []SoundInfo) (SoundInfo, bool)

FindByName searches for a sound by name with 3-level matching: 1. Exact match 2. Case-insensitive match 3. Prefix match (case-insensitive) Built-in sounds are prioritized over system sounds at every level.

Jump to

Keyboard shortcuts

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