sounds

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Provides a way to play sound effects

Index

Constants

View Source
const (
	SELECT_SINGLE int = iota
	SELECT_RANDOM
	SELECT_SEQUENCE
)

Variables

View Source
var ErrSoundNotFound = errors.New("sound could not be found")

Functions

This section is empty.

Types

type Sound

type Sound interface {
	Play()
	Loop()
	Unloop()
	GetName() string

	GetBufferCount() int
	// contains filtered or unexported methods
}

Sound is a playable sound effect

func NewSound

func NewSound(name string, buffers bufferList, selector int, volume int) Sound

NewSound returns a new playable sound object with a given name, a list of buffers and the method used to select one of the buffers when the song is played.

type SoundPlayer

type SoundPlayer interface {
	ListSounds() []string
	GetSound(name string) (Sound, error)
	LoadSounds(root string) error
}

SoundPlayer is a collection of playable sound effects

func NewPlayer

func NewPlayer(name string, cfg common.Config) (SoundPlayer, error)

NewPlayer returns a new SoundPlayer object with the given name according to the provided config. (see pkg/common/config.go)

Jump to

Keyboard shortcuts

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