mp3duration

package module
v0.0.0-...-0716b1a Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 7 Imported by: 2

README

mp3duration

Resolves duration and length of mp3 files as required by Itunes Podcast RSS feed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(duration time.Duration) string

Formats time.Duration according to the duration field of the Itunes Podcast document type definition (hh:mm:ss).

Types

type Info

type Info struct {
	Name         string
	ModTime      time.Time
	Duration     string
	TimeDuration time.Duration
	Seconds      float64
	SecondsInt   int
	Length       int64
	Frames       int
}

func Read

func Read(f *os.File) (duration Info, err error)

Read duration and other information from a file pointer (*os.File, usually a file opened with os.Open()). Returns mp3duration.Info or error.

func ReadFile

func ReadFile(mp3file string) (duration Info, err error)

Open and read duration and other information from MP3 file. Closes the file after reading it. Returns mp3duration.Info or error.

Jump to

Keyboard shortcuts

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