music

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: MIT Imports: 27 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FlacExt      = ".flac"
	Mp3Ext       = ".mp3"
	M3uExt       = ".m3u"
	OpusExt      = ".opus"
	JpgExt       = ".jpg"
	WavExt       = ".wav"
	DefaultCover = "cover.jpg"
)
View Source
const (
	ErrorContainsID3Tags = "flac contains forbidden ID3 tags"
	ErrorUncompressed    = "flac seems to be uncompressed"
)
View Source
const (
	AdditionalMetadataDir = "Metadata"
)

Variables

View Source
var (
	ErrorMaxLengthExceeded = errors.New("max length of path exceeds 180 characters")
)

Functions

func ContainsMusic

func ContainsMusic(directoryPath string) bool

ContainsMusic returns true if it contains mp3 or flac files.

func GetAllFLACs

func GetAllFLACs(directoryPath string) []string

GetAllFLACs returns all FLAC files found in a directory

func GetAllPlaylists added in v0.12.0

func GetAllPlaylists(directoryPath string) []string

GetAllPlaylists returns all m3u files found in a directory

func GetFirstFLACFound

func GetFirstFLACFound(directoryPath string) string

GetFirstFLACFound returns the first FLAC file found in a directory

Types

type Release added in v0.16.0

type Release struct {
	Path         string
	MetadataPath string
	Flacs        []*Track
	Cover        string
}

Release struct to manipulate a folder containing FLAC files and a cover.

func New added in v0.19.4

func New(path string) *Release

func NewWithExternalMetadata added in v0.19.4

func NewWithExternalMetadata(path, metadataPath string) *Release

func (*Release) Analyze added in v0.16.0

func (r *Release) Analyze() error

Analyze the release folder

func (*Release) Check added in v0.19.3

func (r *Release) Check() error

Check the flac md5.

func (*Release) CheckCompression added in v0.25.0

func (r *Release) CheckCompression() error

CheckCompression in the first flac file, to detect uncompressed flacs.

func (*Release) CheckConsistentBitDepth added in v0.25.0

func (r *Release) CheckConsistentBitDepth() (bool, string)

CheckConsistentBitDepth among tracks

func (*Release) CheckConsistentSampleRate added in v0.25.0

func (r *Release) CheckConsistentSampleRate() (bool, string)

CheckConsistentSampleRate among tracks

func (*Release) CheckConsistentTags added in v0.25.0

func (r *Release) CheckConsistentTags() error

func (*Release) CheckDiscNumbersInFilenames added in v0.26.0

func (r *Release) CheckDiscNumbersInFilenames() bool

CheckDiscNumbersInFilenames among all tracks

func (*Release) CheckEncoding added in v0.18.0

func (r *Release) CheckEncoding() error

CheckEncoding will return an error if the flac encoding (bit depth/Hz) varies among the Release's FLACS.

func (*Release) CheckFilenameContainsStartOfTitle added in v0.25.0

func (r *Release) CheckFilenameContainsStartOfTitle(minSize int) bool

CheckFilenameContainsStartOfTitle among all tracks

func (*Release) CheckFilenameOrder added in v0.26.0

func (r *Release) CheckFilenameOrder() (bool, error)

CheckFilenameOrder checks if the alphabetical order of files is also the logical order of tracks.

func (*Release) CheckMaxCoverSize added in v0.25.0

func (r *Release) CheckMaxCoverSize() int

CheckMaxCoverSize among all tracks

func (*Release) CheckMinMaxBitrates added in v0.25.0

func (r *Release) CheckMinMaxBitrates() (int, int)

func (*Release) CheckMultiDiscOrganization added in v0.26.0

func (r *Release) CheckMultiDiscOrganization() error

CheckMultiDiscOrganization checks if multi-disc release are using subfolder or have the disc number in the filenames.

func (*Release) CheckTags added in v0.16.0

func (r *Release) CheckTags() error

CheckTags from FLACs

func (*Release) CheckTrackNumbersInFilenames added in v0.25.0

func (r *Release) CheckTrackNumbersInFilenames() bool

CheckTrackNumbersInFilenames among all tracks

func (*Release) CheckVendor added in v0.27.0

func (r *Release) CheckVendor() error

func (*Release) CleanTags added in v0.16.0

func (r *Release) CleanTags(removeAllArt bool) error

CleanTags from FLACs

func (*Release) EmbedArtwork added in v0.23.0

func (r *Release) EmbedArtwork(cover string, maxSizeKb int) error

EmbedArtwork in all FLACs

func (*Release) GenerateCombinedSpectrogram added in v0.18.2

func (r *Release) GenerateCombinedSpectrogram() (string, error)

GenerateCombinedSpectrogram for all FLACs This generates slices of combinedSliceWindowS seconds centered around the middle of each song, then combines all slices in a single png. It should allow seeing at a glance of a single file is something looks like a lossy mastered flac.

func (*Release) GenerateSpectrograms added in v0.16.0

func (r *Release) GenerateSpectrograms(title string) ([]string, error)

GenerateSpectrograms for all FLACs

func (*Release) Has24bitTracks added in v0.23.2

func (r *Release) Has24bitTracks() bool

Has24bitTracks returns true if at least one track is 24bit.

func (*Release) HasCover added in v0.27.0

func (r *Release) HasCover() bool

func (Release) NumberOfDiscs added in v0.19.5

func (r Release) NumberOfDiscs() int

func (*Release) ParseFiles added in v0.25.0

func (r *Release) ParseFiles() error

func (*Release) Recompress added in v0.16.0

func (r *Release) Recompress() error

Recompress FLACs

func (*Release) TranscodeTo320 added in v0.18.0

func (r *Release) TranscodeTo320(cbr320FolderName string) error

TranscodeTo320 a given Release's FLAC files

func (*Release) TranscodeToV0 added in v0.18.0

func (r *Release) TranscodeToV0(v0FolderName string) error

TranscodeToV0 a given Release's FLAC files

type Track added in v0.18.0

type Track struct {
	Path            string     `json:"-"`
	Filename        string     `json:"filename"`
	MD5             string     `json:"md5"`
	BitDepth        string     `json:"bit_depth"`
	SampleRate      string     `json:"sample_rate"`
	TotalSamples    string     `json:"total_samples"`
	Duration        string     `json:"duration"`
	DurationSeconds float32    `json:"-"`
	Fingerprint     string     `json:"fingerprint,omitempty"`
	Tags            *TrackTags `json:"tags"`
	HasCover        bool       `json:"has_cover"`
	CoverSize       int        `json:"cover_size"`
	Size            int        `json:"size"`
	AverageBitRate  int        `json:"average_bitrate"`
}

func NewTrack added in v0.18.0

func NewTrack(path, filename string) (*Track, error)

func NewTrackWithoutMetadata added in v0.21.2

func NewTrackWithoutMetadata(path, filename string, tt *TrackTags) (*Track, error)

func (*Track) ApplyMetadata added in v0.21.2

func (t *Track) ApplyMetadata() error

func (*Track) FullPath added in v0.18.0

func (t *Track) FullPath() string

func (*Track) HasMinimalTags added in v0.18.0

func (t *Track) HasMinimalTags() bool

func (*Track) String added in v0.18.0

func (t *Track) String() string

func (*Track) Vendor added in v0.27.0

func (t *Track) Vendor() (string, error)

type TrackTags added in v0.18.0

type TrackTags struct {
	TrackNumber string
	TotalTracks string
	DiscNumber  string
	TotalDiscs  string
	Artist      []string
	AlbumArtist []string
	Performer   []string
	Conductor   []string
	Author      []string
	Composer    []string
	Remixer     []string
	Guest       []string
	Title       string
	Description string
	Date        string
	Year        string
	Genre       string
	Album       string
	Label       string
	Version     string
	ISRC        string
	UPC         string
	Media       string
	Duration    int
	OtherTags   map[string]string
}

func NewTrackMetadata added in v0.18.0

func NewTrackMetadata(tags map[string]string) (*TrackTags, error)

func (*TrackTags) PaddedNumber added in v0.19.6

func (tt *TrackTags) PaddedNumber() string

PaddedNumber for track

func (*TrackTags) SetStrings added in v0.21.2

func (tt *TrackTags) SetStrings() []string

func (*TrackTags) String added in v0.18.0

func (tt *TrackTags) String() string

Jump to

Keyboard shortcuts

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