metadata_extraction

package
v0.0.0-...-6217932 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MPEG_V25 = 0
	MPEG_V2  = 2
	MPEG_V1  = 3

	LAYER_I   = 3
	LAYER_II  = 2
	LAYER_III = 1
)

Variables

View Source
var (
	NoMetadata      = errors.New("No audio metadata")
	UnknownMimeType = errors.New("Unknown MIME type")
)

Functions

func GetMetadata

func GetMetadata(path, mimeType string) (*api.AudioFile, *api.Meta, error)

func GuessMetadata

func GuessMetadata(path string) (*api.AudioFile, *api.Meta, error)

Types

type FLAC

type FLAC struct{}

func (FLAC) GetMetadata

func (f FLAC) GetMetadata(path string) (*api.AudioFile, *api.Meta, error)

ExtractMetadata reads a (local) FLAC file and returns audio encoding parameters and song metadata as two separate objects.

type MP3

type MP3 struct{}

func (MP3) GetMetadata

func (m MP3) GetMetadata(path string) (*api.AudioFile, *api.Meta, error)

type MetadataExtractor

type MetadataExtractor interface {
	GetMetadata(path string) (*api.AudioFile, *api.Meta, error)
}

type MpegFrameHeader

type MpegFrameHeader []byte

func NewMpegFrameHeader

func NewMpegFrameHeader() MpegFrameHeader

func ReadMpegFrame

func ReadMpegFrame(r io.Reader) (MpegFrameHeader, []byte)

ReadMpegFrame returns the next frame header and data in the input stream. Note that this function makes no attempt at decoding the actual MPEG bitstream.

func (MpegFrameHeader) Bitrate

func (hdr MpegFrameHeader) Bitrate() int

func (MpegFrameHeader) Channels

func (hdr MpegFrameHeader) Channels() int

func (MpegFrameHeader) FrameSize

func (hdr MpegFrameHeader) FrameSize() (flen int)

func (MpegFrameHeader) HasCRC

func (hdr MpegFrameHeader) HasCRC() bool

func (MpegFrameHeader) IsValid

func (hdr MpegFrameHeader) IsValid() bool

func (MpegFrameHeader) MpegLayer

func (hdr MpegFrameHeader) MpegLayer() int

func (MpegFrameHeader) MpegVersion

func (hdr MpegFrameHeader) MpegVersion() int

func (MpegFrameHeader) Padding

func (hdr MpegFrameHeader) Padding() int

func (MpegFrameHeader) SampleRate

func (hdr MpegFrameHeader) SampleRate() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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