session

package
v0.0.0-...-83c7bd8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAmbience

func NewAmbience(next mix.Source, fade, chunkSize mix.Tz) mix.SourceMutator

func NewMusic

func NewMusic(mus, next mix.Source, fade, chunkSize mix.Tz) mix.SourceMutator

Types

type Ambience

type Ambience struct {
	*Session
	// contains filtered or unexported fields
}

func (Ambience) Mutate

func (a Ambience) Mutate(cur mix.Source, pos mix.Tz) mix.Source

type Effect

type Effect struct {
	*Session
}

type Music

type Music struct {
	*Session
	// contains filtered or unexported fields
}

func (Music) Mutate

func (m Music) Mutate(cur mix.Source, pos mix.Tz) mix.Source

type Region

type Region struct {
	Source          mix.Source // Audio to play.
	Begin           mix.Tz     // Time to begin playing in session samples.
	Offset, Length  mix.Tz     // Offset and Length in Source that will be played.
	Volume, Pan     float32    // Volume gain and stereo panning.
	FadeIn, FadeOut mix.Tz     // Length of fades.
}

Region defines where and how Source audio (or its part) will be played.

type Session

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

Session mixes collection of Regions. Output is done in 32-bit float WAV. Session implements Source, so it could be nested.

func NewSession

func NewSession(sampleRate mix.Tz, forgetPast bool) *Session

NewSession creates Session with given sampleRate.

func (*Session) AddRegion

func (s *Session) AddRegion(r Region) error

AddRegion adds region to the Session mix.

func (*Session) Clone

func (s *Session) Clone() mix.Source

Returns shallow copy of Session. Sources that are used in regions are not cloned.

func (*Session) Length

func (s *Session) Length() mix.Tz

Length returns end of last region in Session

func (*Session) NumChannels

func (s *Session) NumChannels() int

NumChannels returns number of channels in Session

func (*Session) Position

func (s *Session) Position() mix.Tz

Position returns current Session position.

func (*Session) SampleRate

func (s *Session) SampleRate() mix.Tz

SampleRate returns sample rate of Session.

func (*Session) Samples

func (s *Session) Samples(channel int, offset, length mix.Tz) mix.Buffer

func (*Session) SetPosition

func (s *Session) SetPosition(pos mix.Tz)

SetPosition sets current Session position.

Jump to

Keyboard shortcuts

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