libflac

package module
v0.0.0-...-50ea06e Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2017 License: BSD-3-Clause Imports: 8 Imported by: 6

README

Go libFLAC bindings

These bindings allow decoding and encoding of FLAC format audio data from Go using the libFLAC library.

Build Status

Coverage Status

Installation
go get github.com/cocoonlife/goflac
Status

The code has support for decoding and encoding with various parameters however it is only quite lightly tested so it is likely that bugs remain.

Documentation

Overview

Package libflac provides Go bindings to the libFLAC codec library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	Channels int
	Depth    int
	Rate     int
	// contains filtered or unexported fields
}

Decoder is a FLAC decoder.

func NewDecoder

func NewDecoder(name string) (d *Decoder, err error)

NewDecoder creates a new Decoder object.

func NewDecoderReader

func NewDecoderReader(reader io.ReadCloser) (d *Decoder, err error)

NewDecoderReader creates a new Decoder object from a Reader.

func (*Decoder) Close

func (d *Decoder) Close()

Close closes a decoder and frees the resources.

func (*Decoder) ReadFrame

func (d *Decoder) ReadFrame() (f *Frame, err error)

ReadFrame reads a frame of audio data from the decoder.

type Encoder

type Encoder struct {
	Channels int
	Depth    int
	Rate     int
	// contains filtered or unexported fields
}

Encoder is a FLAC encoder.

func NewEncoder

func NewEncoder(name string, channels int, depth int, rate int) (e *Encoder, err error)

NewEncoder creates a new Encoder object.

func NewEncoderWriter

func NewEncoderWriter(writer FlacWriter, channels int, depth int, rate int) (e *Encoder, err error)

NewEncoderWriter creates a new Encoder object from a FlacWriter.

func (*Encoder) Close

func (e *Encoder) Close()

Close closes an encoder and frees the resources.

func (*Encoder) WriteFrame

func (e *Encoder) WriteFrame(f Frame) (err error)

WriteFrame writes a frame of audio data to the encoder.

type FlacWriter

type FlacWriter interface {
	io.Writer
	io.Closer
	io.Seeker
}

type Frame

type Frame struct {
	Channels int
	Depth    int
	Rate     int
	Buffer   []int32
}

Frame is an interleaved buffer of audio data with the specified parameters.

Jump to

Keyboard shortcuts

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