Version: v0.0.0-...-a30bb4d Latest Latest

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 10 Imported by: 3




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
View Source
const (
	FFMPEGEncoder = "ffmpeg"


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",


func GetEncoderName

func GetEncoderName() string

func IsCommandAvailable

func IsCommandAvailable(name string) bool


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) 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
t or T : Toggle theme light dark auto
y or Y : Canonical URL