Documentation ¶
Index ¶
- Variables
- func Assert(file string) error
- func WriteMetadata(file string, m audio.Metadata) error
- type Encoder
- type Metadata
- func (m *Metadata) Comment() string
- func (m *Metadata) Copyright() string
- func (m *Metadata) EncodedBy() string
- func (m *Metadata) EncoderSettings() string
- func (m *Metadata) Encoding() audio.Codec
- func (m *Metadata) EncodingBitrate() int
- func (m *Metadata) Length() time.Duration
- func (m *Metadata) OriginalFilename() string
- func (m *Metadata) PrivateData() []byte
- func (m *Metadata) Website() string
- func (m *Metadata) Year() int
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotMP3 = errors.New("file is not an MP3")
Functions ¶
Types ¶
type Encoder ¶
func NewEncoder ¶
func NewEncoder() *Encoder
func (*Encoder) EncodeFromStdin ¶
EncodeFromStdin takes a command that produces a decoded file on stdout, and pipes that through an mp3 encoder. It tags the MP3 with audio metadata received.
For example:
enc := mp3.Encoder{q} dec := exec.Command("flac", "-c", "-d", src) bs, err = enc.EncodeFromStdin(dec, path, md.Metadata())
type Metadata ¶
type Metadata struct { // Metadata is an interface that already implements: // // Format() tag.Format // FileType() tag.FileType // // Title() string // Album() string // Artist() string // AlbumArtist() string // Composer() string // Year() int // Genre() string // Track() (int, int) // Disc() (int, int) // // Picture() *tag.Picture // Lyrics() string // Raw() map[string]interface{} tag.Metadata // contains filtered or unexported fields }
func ReadMetadata ¶
Runtime stats:
audio.Identify μ=5.221595ms, σ=6.688962ms, n=12233 audio.ReadMetadata μ=69.826077ms, σ=89.871762ms, n=4694 flac.Identify μ=-2562047h47m16.854775808s, σ=-2562047h47m16.854775808s, n=0 flac.ReadFileMetadata μ=2.412411ms, σ=4.72771ms, n=2399 flac.ReadMetadata μ=2.399813ms, σ=4.72703ms, n=2399 mp3.Assert μ=11.714µs, σ=2.509µs, n=2295 mp3.ReadMetadata μ=140.255738ms, σ=82.368328ms, n=2295
Runtime stats:
audio.Identify μ=5.497306ms, σ=6.697311ms, n=12233 audio.ReadMetadata μ=71.437403ms, σ=96.427961ms, n=4694 flac.Identify μ=-2562047h47m16.854775808s, σ=-2562047h47m16.854775808s, n=0 flac.ReadFileMetadata μ=2.538888ms, σ=5.32524ms, n=2399 flac.ReadMetadata μ=2.526025ms, σ=5.324577ms, n=2399 mp3.Assert μ=11.556µs, σ=2.889µs, n=2295 mp3.ReadMetadata μ=143.417326ms, σ=94.047081ms, n=2295 mp3.ReadMetadataMeta μ=2.657978ms, σ=5.662125ms, n=2295 mp3.ReadMetadataBrDu μ=140.729045ms, σ=92.607449ms, n=2295 mp3.ToolMP3INFO μ=-2562047h47m16.854775808s, σ=-2562047h47m16.854775808s, n=0 mp3.ToolEXIFTOOL μ=-2562047h47m16.854775808s, σ=-2562047h47m16.854775808s, n=0
func (*Metadata) EncoderSettings ¶
func (*Metadata) EncodingBitrate ¶
func (*Metadata) OriginalFilename ¶
func (*Metadata) PrivateData ¶
Click to show internal directories.
Click to hide internal directories.