encode

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Profiles = map[string]*Profile{
		"mp3":     {"mp3", 128, []string{"-c:a", "libmp3lame"}, false},
		"mp3_rg":  {"mp3", 128, []string{"-c:a", "libmp3lame"}, true},
		"opus":    {"opus", 96, []string{"-c:a", "libopus", "-vbr", "constrained"}, false},
		"opus_rg": {"opus", 96, []string{"-c:a", "libopus", "-vbr", "constrained"}, true},
	}
)

Functions

func CacheKey

func CacheKey(sourcePath string, profile, bitrate string) string

generate cache key (file name). for, you know, encoded tracks cache

func Encode

func Encode(out io.Writer, trackPath, cachePath string, profile *Profile, bitrate string) error

func GetBitrate

func GetBitrate(clientBitrate int, profile *Profile) string

check if client forces bitrate lower than set in profile

Types

type Profile

type Profile struct {
	Format  string
	Bitrate int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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