libflac

package module
v0.0.0-...-b55589f Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: BSD-3-Clause Imports: 8 Imported by: 1

README

Go libFLAC bindings

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

Fork of github.com/cocoonlife/goflac with go.mod and API additions.

Build Status

Installation
go get git.gammaspectra.live/S.O.N.G/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

func Vendor

func Vendor() string

func Version

func Version() string

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 NewDecoderOgg

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

NewDecoderOgg 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 NewDecoderReaderOgg

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

NewDecoderReaderOgg creates a new Decoder object from a Reader of Ogg.

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 NewEncoderOgg

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

NewEncoderOgg creates a new Encoder object.

func NewEncoderWriteSeeker

func NewEncoderWriteSeeker(writer FlacWriter, channels int, depth int, rate int, compressionLevel int, streamable bool, blockSize int) (e *Encoder, err error)

NewEncoderWriteSeeker creates a new Encoder object from a FlacWriter.

func NewEncoderWriteSeekerOgg

func NewEncoderWriteSeekerOgg(writer FlacWriter, channels int, depth int, rate int, compressionLevel int, streamable bool, blockSize int) (e *Encoder, err error)

NewEncoderWriteSeekerOgg creates a new Encoder object from a FlacWriter.

func NewEncoderWriter

func NewEncoderWriter(writer io.WriteCloser, channels int, depth int, rate int, compressionLevel int, streamable bool, blockSize int) (e *Encoder, err error)

NewEncoderWriter creates a new Encoder object from an io.WriteCloser.

func NewEncoderWriterOgg

func NewEncoderWriterOgg(writer io.WriteCloser, channels int, depth int, rate int, compressionLevel int, streamable bool, blockSize int) (e *Encoder, err error)

NewEncoderWriterOgg creates a new Encoder object from an io.WriteCloser.

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