sound

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Precache

func Precache() error

Types

type GroupedSound

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

func (*GroupedSound) CheckGC

func (g *GroupedSound) CheckGC() dontgc.State

CheckGC checks if GC is currently allowed. Grouped sounds may be GC'd only while not playing.

func (*GroupedSound) Close

func (g *GroupedSound) Close()

Close stops a grouped sound.

func (*GroupedSound) Current

func (g *GroupedSound) Current() time.Duration

Current returns the current playback position.

func (*GroupedSound) IsPlaying

func (g *GroupedSound) IsPlaying() bool

IsPlaying returns whether the sound is currently playing.

func (*GroupedSound) Play

func (g *GroupedSound) Play()

Play starts a grouped sound.

func (*GroupedSound) Reset

func (g *GroupedSound) Reset()

Reset restarts a grouped sound.

type Sound

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

Sound represents a sound effect.

func Load

func Load(name string) (*Sound, error)

Load loads a sound effect. Multiple Load calls to the same sound effect return the same cached instance.

func (*Sound) Grouped

func (s *Sound) Grouped() *GroupedSound

PlayGrouped starts the given sound effect in a grouped fashion.

func (*Sound) Play

func (s *Sound) Play() *audiowrap.Player

Play plays the given sound effect.

func (*Sound) PlayAtVolume

func (s *Sound) PlayAtVolume(vol float64) *audiowrap.Player

PlayAtVolume plays the given sound effect at the given volume.

Jump to

Keyboard shortcuts

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