format

package
v0.0.0-...-9b974ee Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Interface for supported audio format implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("not supported audio format")

Functions

func Register

func Register(f Format)

Types

type Decoder

type Decoder interface {
	// Read decode piece of data and returns raw PCM audio data.
	Read(buf []byte) (read int, err error)
	// Seek sets new position in seconds to start decoding from. If rel
	// parameter is set new position will be calculated as current plus
	// pos, otherwise pos is an absolute seconds position.
	Seek(pos int, rel bool) error
	// Time returns current decoded position in seconds.
	Time() int
	// SampleRate returns sample rate of decoded stream.
	SampleRate() int
	// Channels returns number of channels in decoded stream.
	Channels() int
	// Close releases decoder resources.
	Close()
}

Decoder interface represents audio decoder for the particular audio format.

func GetDecoder

func GetDecoder(path string) (Decoder, error)

type Format

type Format interface {
	Extensions() []string
	Metadata(path string) (Metadata, error)
	Decoder(path string) (Decoder, error)
}

type Metadata

type Metadata interface {
	Artist() string
	Album() string
	Title() string
	Number() int
	Length() int
}

func GetMetadata

func GetMetadata(path string) (Metadata, error)

Directories

Path Synopsis
FFmpeg audio decoder format.
FFmpeg audio decoder format.

Jump to

Keyboard shortcuts

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