source

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 6 Imported by: 6

Documentation

Overview

Package source models a single audio source

Package source models a single audio source

Index

Constants

View Source
const (
	STAGED stateEnum = iota
	LOADING
	READY
)

Variables

This section is empty.

Functions

func Configure

func Configure(s spec.AudioSpec)

func Count

func Count() int

Count the number of sources in memory

func GetLength

func GetLength(src string) spec.Tz

func Prepare

func Prepare(src string)

Prepare a source by ensuring it is stored in memory.

func Prune

func Prune(keep map[string]bool)

Prune to keep only the sources in this list

Types

type Source

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

Source stores a series of Samples in Channels across Time, for audio playback.

func Get

func Get(src string) *Source

Get a source from storage

func New

func New(URL string) *Source

New Source from a "URL" (which is actually only a file path for now)

func (*Source) Length

func (s *Source) Length() spec.Tz

Length of the source audio in Tz

func (*Source) SampleAt

func (s *Source) SampleAt(at spec.Tz, vol float64, pan float64) (out []sample.Value)

SampleAt at a specific Tz, volume (0 to 1), and pan (-1 to +1)

func (*Source) Spec

func (s *Source) Spec() *spec.AudioSpec

Spec of the source audio

func (*Source) Teardown

func (s *Source) Teardown()

Teardown the source audio and release its memory.

Jump to

Keyboard shortcuts

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