execdriver

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package execdriver provides a command-based audio driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Path string
	Args []string
}

Command describes the command used to play an audio cue. Use {{path}} and {{volume}} placeholders inside args.

func DefaultCommand

func DefaultCommand() (Command, bool)

DefaultCommand returns the first command candidate for this OS.

func DefaultCommandCandidates

func DefaultCommandCandidates() []Command

DefaultCommandCandidates returns OS-specific command options.

func DetectCommand

func DetectCommand() (Command, bool)

DetectCommand returns the first available command in PATH.

type Config

type Config struct {
	Command Command
	Sources map[string]Source
}

Config configures a command driver.

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver executes external commands to play audio.

func NewDriver

func NewDriver(cfg Config) *Driver

NewDriver creates a command-based audio driver.

func (*Driver) Play

func (d *Driver) Play(cue audio.Cue) error

Play starts a command for the cue.

func (*Driver) Register

func (d *Driver) Register(id string, src Source)

Register adds or replaces a cue source.

func (*Driver) Stop

func (d *Driver) Stop(kind audio.Kind) error

Stop stops music playback.

type Source

type Source struct {
	Path    string
	Command Command
}

Source maps a cue ID to a file path and optional command override.

Jump to

Keyboard shortcuts

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