audio

package
v0.0.0-...-d5cfa09 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShortBuffer = errors.New("buffer too short")
)

Functions

func NewRecordStream

func NewRecordStream() io.ReadCloser

Types

type Player

type Player struct {
	Writer *Writer
}

func NewPlayer

func NewPlayer() *Player

func (*Player) LoadAndPlay

func (p *Player) LoadAndPlay(uri string) error

func (*Player) LoadMP3

func (p *Player) LoadMP3(uri string) (*Writer, error)

func (*Player) LoadMP3Reader

func (p *Player) LoadMP3Reader(r io.Reader) (*Writer, error)

type Reader

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

func NewReader

func NewReader(rate, channel, frames int) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(buf []byte) (int, error)

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}
var (
	DefaultRecorder *Recorder
)

func NewRecorder

func NewRecorder(rate, channel int) (*Recorder, error)

func (*Recorder) NewStream

func (r *Recorder) NewStream() io.ReadCloser

type Writer

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

func NewWriter

func NewWriter(rate, channel int, buffer []byte) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Closed

func (w *Writer) Closed() bool

func (*Writer) Len

func (w *Writer) Len() time.Duration

func (*Writer) Offset

func (w *Writer) Offset() time.Duration

func (*Writer) Pause

func (w *Writer) Pause()

func (*Writer) Play

func (w *Writer) Play() error

func (*Writer) Resume

func (w *Writer) Resume()

func (*Writer) SetOffset

func (w *Writer) SetOffset(offset time.Duration)

func (*Writer) Start

func (w *Writer) Start() error

func (*Writer) Wait

func (w *Writer) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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