audio

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Music

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

Music is used to read samples from a music file

func NewMusic

func NewMusic() *Music

NewMusic constructs a new music reader

func (*Music) Close added in v1.0.3

func (m *Music) Close() error

Close closes the music

func (*Music) Load

func (m *Music) Load(filePath string) (int, error)

Load loads a music file from a given path

func (*Music) Read added in v1.0.3

func (m *Music) Read() ([]byte, error)

Read reads samples from the music file

type Player

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

Player is used to play music from samples

func NewPlayer

func NewPlayer() *Player

NewPlayer constructs a new music player

func (*Player) Close added in v1.0.3

func (p *Player) Close() error

Close closes the player

func (*Player) Prepare

func (p *Player) Prepare(sampleRate int) error

Prepare sets the sample rate of the player

func (*Player) Write

func (p *Player) Write(samples []byte) (int, error)

Write writes the given samples to the player

Jump to

Keyboard shortcuts

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