openal

package
v0.0.0-...-4c1a193 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVolume

func GetVolume() float32

GetVolume returns the master volume.

func PauseAll

func PauseAll()

PauseAll will pause all sources

func PlayAll

func PlayAll()

PlayAll will play all sources

func RewindAll

func RewindAll()

RewindAll will rewind all sources

func SetVolume

func SetVolume(gain float32)

SetVolume sets the master volume

func StopAll

func StopAll()

StopAll stop all sources

Types

type Source

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

Source manages decoding sound data, creates an openal sound and manages the data associated with the source.

func NewSource

func NewSource(filepath string, static bool) (*Source, error)

NewSource creates a new Source from a file at the path provided. If you specify a static source it will all be buffered into a single buffer. If false then it will create many buffers a cycle through them with data chunks. This allows a smaller memory footprint while playing bigger music files. You may want a static file if the sound is less than 2 seconds. It allows for faster cleaning playing of shorter sounds like footsteps.

func (*Source) GetDuration

func (s *Source) GetDuration() time.Duration

GetDuration returns the total duration of the source.

func (*Source) GetPitch

func (s *Source) GetPitch() float32

GetPitch returns the current pitch of the Source in the range 0.0, 1.0

func (*Source) GetState

func (s *Source) GetState() string

GetState returns the playing state of the source.

func (*Source) GetVolume

func (s *Source) GetVolume() float32

GetVolume returns the current volume of the Source.

func (*Source) IsFinished

func (s *Source) IsFinished() bool

IsFinished will return true if the source is at the end of its duration and it is not a looping source.

func (*Source) IsLooping

func (s *Source) IsLooping() bool

IsLooping returns whether the Source will loop.

func (*Source) IsPaused

func (s *Source) IsPaused() bool

IsPaused returns whether the Source is paused.

func (*Source) IsPlaying

func (s *Source) IsPlaying() bool

IsPlaying returns whether the Source is playing.

func (*Source) IsStatic

func (s *Source) IsStatic() bool

IsStatic returns whether the Source is static or stream.

func (*Source) IsStopped

func (s *Source) IsStopped() bool

IsStopped returns whether the Source is stopped.

func (*Source) Pause

func (s *Source) Pause()

Pause pauses the source.

func (*Source) Play

func (s *Source) Play() bool

Play starts playing the source.

func (*Source) Resume

func (s *Source) Resume()

Resume resumes a paused source.

func (*Source) Rewind

func (s *Source) Rewind()

Rewind rewinds the source source to its start time.

func (*Source) Seek

func (s *Source) Seek(offset time.Duration)

Seek sets the currently playing position of the Source.

func (*Source) SetLooping

func (s *Source) SetLooping(loop bool)

SetLooping sets whether the Source should loop when the source is complete.

func (*Source) SetPitch

func (s *Source) SetPitch(p float32)

SetPitch sets the pitch of the Source, the value should be between 0.0, 1.0

func (*Source) SetVolume

func (s *Source) SetVolume(v float32)

SetVolume sets the current volume of the Source.

func (*Source) Stop

func (s *Source) Stop()

Stop stops a playing source.

func (*Source) Tell

func (s *Source) Tell() time.Duration

Tell returns the currently playing position of the Source.

Directories

Path Synopsis
Package al provides OpenAL Soft bindings for Go.
Package al provides OpenAL Soft bindings for Go.
Package decoding is used for converting familiar file types to data usable by OpenAL.
Package decoding is used for converting familiar file types to data usable by OpenAL.

Jump to

Keyboard shortcuts

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