flac

package module
v0.0.0-...-9a6fb92 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 8 Imported by: 7

README

Flac

A Free Lossless Audio Codec decoder in Go.

Usage

For the moment, you can decode foo.flac using: go run main.go < foo.flac

Documentation

Overview

Package flac implements a Free Lossless Audio Codec (FLAC) decoder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	MetaData
	// contains filtered or unexported fields
}

A Decoder decodes a FLAC audio file. Unlike the Decode function, a decoder can decode the file incrementally, one frame at a time.

func NewDecoder

func NewDecoder(r io.Reader) (*Decoder, error)

NewDecoder reads the FLAC header information and returns a new Decoder. If an error is encountered while reading the header information then nil is returned along with the error.

func (*Decoder) Next

func (d *Decoder) Next() ([]byte, error)

Next returns the audio data from the next frame.

type MetaData

type MetaData struct {
	*StreamInfo
	*VorbisComment
}

MetaData contains metadata header information from a FLAC file header.

func Decode

func Decode(r io.Reader) ([]byte, MetaData, error)

Decode reads a FLAC file, decodes it, verifies its MD5 checksum, and returns the data and metadata.

type StreamInfo

type StreamInfo struct {
	MinBlock      int
	MaxBlock      int
	MinFrame      int
	MaxFrame      int
	SampleRate    int
	NChannels     int
	BitsPerSample int
	TotalSamples  int64
	MD5           [md5.Size]byte
}

StreamInfo contains information about the FLAC stream.

type VorbisComment

type VorbisComment struct {
	Vendor   string
	Comments []string
}

VorbisComment (a.k.a. FLAC tags) contains Vorbis-style comments that are human-readable textual information.

Jump to

Keyboard shortcuts

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