music

package
v0.45.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 28 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 (
	AdditionalMetadataDir = "Metadata"
)

Variables

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

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        []*flac.Flac
	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) CheckAlbumArtist added in v0.28.0

func (r *Release) CheckAlbumArtist() error

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(withDisc bool) (bool, error)

func (*Release) CheckForID3v1Tags added in v0.32.0

func (r *Release) CheckForID3v1Tags() error

CheckForID3v1Tags in the first flac file.

func (*Release) CheckForMissingTracks added in v0.42.0

func (r *Release) CheckForMissingTracks() error

func (*Release) CheckMaxCoverAndPaddingSize added in v0.32.0

func (r *Release) CheckMaxCoverAndPaddingSize() int

CheckMaxCoverAndPaddingSize among all tracks.

func (*Release) CheckMaxMetadataSize added in v0.32.0

func (r *Release) CheckMaxMetadataSize(maxSize int) []error

CheckMaxMetadataSize among all tracks.

func (*Release) CheckMinMaxBitrates added in v0.25.0

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

func (*Release) CheckMinimalTags added in v0.38.3

func (r *Release) CheckMinimalTags() []error

CheckMinimalTags from FLACs.

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) 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) ClearMemory added in v0.39.4

func (r *Release) ClearMemory()

ClearMemory from FLACs content.

func (*Release) ClearMetadata added in v0.31.0

func (r *Release) ClearMetadata() error

ClearMetadata 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(verbose bool) (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, verbose bool) ([]string, error)

GenerateSpectrograms for all FLACs.

func (*Release) GetRawTags added in v0.37.3

func (r *Release) GetRawTags() string

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) HasTracksInSubfolders added in v0.28.0

func (r *Release) HasTracksInSubfolders() bool

func (*Release) IsMultiDisc added in v0.28.0

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

func (Release) NumberOfDiscs added in v0.19.5

func (r Release) NumberOfDiscs() int

NumberOfDiscs in the release.

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.

Jump to

Keyboard shortcuts

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