converter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MP3BitRateEconomy  = 64 * 1000
	MP3BitRateStandard = 128 * 1000
	MP3BitRateGood     = 192 * 1000
	MP3BitRatePerfect  = 320 * 1000

	M4ABitRateEconomy  = 64 * 1000
	M4ABitRateStandard = 128 * 1000
	M4ABitRateGood     = 160 * 1000
	M4ABitRatePerfect  = 256 * 1000
)

Variables

View Source
var (
	DefaultCodecs = map[string]string{
		"ogg": "libvorbis",
	}
	ValidCoverExtensions = utils.NewSet(".png", ".jpg", ".jpeg", ".bmp", ".tif", ".tiff")
	ValidID3TagVersions  = utils.NewSet(3, 4)
	FileExtAlias         = map[string]string{
		"wave": "wav",
	}
)

Functions

func GetEncoderName

func GetEncoderName() string

GetEncoderName returns the name of the encoder program, just ffmpeg for now.

func IsCommandAvailable

func IsCommandAvailable() bool

IsCommandAvailable returns true if the known encoder program is available from the system path.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

func NewConverter

func NewConverter(w io.Writer) *Converter

func (*Converter) Convert

func (c *Converter) Convert(src interface{}) error

func (*Converter) DstFormat

func (c *Converter) DstFormat() string

func (*Converter) WithBitRate

func (c *Converter) WithBitRate(rate int) *Converter

func (*Converter) WithChannels

func (c *Converter) WithChannels(v int) *Converter

func (*Converter) WithCodec

func (c *Converter) WithCodec(codec string) *Converter

func (*Converter) WithCover

func (c *Converter) WithCover(coverPath string) *Converter

func (*Converter) WithDstFormat

func (c *Converter) WithDstFormat(f string) *Converter

func (*Converter) WithID3TagVersion

func (c *Converter) WithID3TagVersion(v int) *Converter

func (*Converter) WithParams

func (c *Converter) WithParams(p ...string) *Converter

func (*Converter) WithSampleRate

func (c *Converter) WithSampleRate(rate int) *Converter

func (*Converter) WithStartSeek

func (c *Converter) WithStartSeek(v int) *Converter

func (*Converter) WithTags

func (c *Converter) WithTags(tags map[string]string) *Converter

func (*Converter) WithWriter

func (c *Converter) WithWriter(w io.Writer) *Converter

type EncodeError

type EncodeError string

func (EncodeError) Error

func (e EncodeError) Error() string

type InvalidCoverError

type InvalidCoverError string

func (InvalidCoverError) Error

func (e InvalidCoverError) Error() string

type InvalidID3TagVersionError

type InvalidID3TagVersionError string

func (InvalidID3TagVersionError) Error

Jump to

Keyboard shortcuts

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