Documentation
¶
Overview ¶
Package streammeta extracts now-playing data from live audio streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NowPlaying ¶
type NowPlaying struct {
// Raw is the unmodified stream title.
Raw string `json:"raw"`
// Artist is populated when the title follows an artist-title form.
Artist string `json:"artist,omitempty"`
// Title is the song, program, or complete stream title.
Title string `json:"title"`
// Program is a station-supplied show or programme name when available.
Program string `json:"program,omitempty"`
// Artwork is the current station or track artwork URL.
Artwork string `json:"artwork,omitempty"`
// ChangedAt is when this title became current.
ChangedAt time.Time `json:"changed_at,omitzero"`
}
NowPlaying is a normalized live-stream metadata update.
func Parse ¶
func Parse(raw string) NowPlaying
Parse converts a raw stream title into structured fields.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader removes interleaved metadata while passing audio to a decoder.
func NewReader ¶
func NewReader(source io.ReadCloser, interval int, onTitle func(string)) *Reader
NewReader wraps an ICY response body with its advertised metadata interval.
type Source ¶
type Source struct {
// Body contains audio with any interleaved ICY blocks removed.
Body io.ReadCloser
// ContentType is the normalized response media type.
ContentType string
// StationName is the server's advertised station name.
StationName string
// Playlist reports content that the decoder must open by URL to retain a base path.
Playlist bool
}
Source is an open live response that can be passed directly to a decoder.
Click to show internal directories.
Click to hide internal directories.