sound

package
v1.5.129 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Precache

func Precache(s *splash.State) (splash.Status, 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) IsPlayingNotForGameplay

func (g *GroupedSound) IsPlayingNotForGameplay() bool

IsPlayingNotForGameplay returns whether the sound is currently playing. As this may depend on hardware, do not use this for gameplay.

func (*GroupedSound) Play

func (g *GroupedSound) Play()

Play starts a grouped sound.

func (*GroupedSound) PositionNotForGameplay added in v1.4.72

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

PositionNotForGameplay returns the current playback position. As this may depend on hardware, do not use this for gameplay.

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) DurationNotForGameplay

func (s *Sound) DurationNotForGameplay() time.Duration

DurationNotForGameplay returns how long a sound takes. As this may depend on hardware, do not use this for gameplay.

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