buffers

package
v0.0.0-...-e1971a2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStreamSeeker

func GetStreamSeeker(b IBuffers, path string, t *testing.T) beep.StreamSeeker

func LoadPath

func LoadPath(b IBuffers, path string, t *testing.T)

Types

type Buffers

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

func CastToBuffers

func CastToBuffers(b IBuffers, t *testing.T) *Buffers

func (*Buffers) GetFormat

func (h *Buffers) GetFormat() (beep.Format, error)

GetFormat returns the common format of all buffers

func (*Buffers) GetStreamSeeker

func (h *Buffers) GetStreamSeeker(path string) (beep.StreamSeeker, error)

GetStreamSeeker returns a StreamSeeker from a buffer.

func (*Buffers) Load

func (h *Buffers) Load(path string) error

Load loads audio files from paths into a buffer. Calling this method with files already loaded takes no action. This method only supports loading mp3 files, though it's not hard to add more audio formats.

func (*Buffers) Release

func (h *Buffers) Release(path string)

Release frees audio files' memory from buffer. Calling this method with a track already released takes no action.

func (*Buffers) ReleaseAll

func (h *Buffers) ReleaseAll()

ReleaseAll frees all audio files' memory from buffer.

type IBuffers

type IBuffers interface {
	Load(path string) error
	Release(path string)
	ReleaseAll()
	GetStreamSeeker(path string) (beep.StreamSeeker, error)
	GetFormat() (beep.Format, error)
}

func New

func New(r reader.IReader) IBuffers

New returns an implementation of IBuffers. If reader is nil, then the default reader.FileReader is used.

Jump to

Keyboard shortcuts

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