icy

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 3 Imported by: 0

README

icy

A dead simple Icecast transmission library for Go, with support for in-band metadata. Icy will figure out the song's title from id3v2 tags in MP3s, or use the filename as a fallback. This behaviour can be changed with SetTitleHandler.

Icy supports whatever input files ffmpeg can transcode. Incidentally, ffmpeg has to be available on the system path for it to work. The original solution decoded MP3 files using a pure Go library, but it didn't work very well.

Icy uses ffmpeg to transcode all input files into a 44.1kHz/192kb double channel MPEG stream.

API

See the pkgsite documentation.

Examples

// shuffles all MP3 files in every subdirectory of mysongs
icy.Shuffle("./mysongs/*/*.mp3", icy.RadioDetails{})

// plays all M4A files in the current directory in order
icy.Play("*.m4a", icy.RadioDetails{})

Documentation

Overview

Package icy is a dead simple Icecast transmission library for Go, with support for in-band metadata.

Index

Constants

This section is empty.

Variables

View Source
var DefaultTitleHandler = icy.DefaultTitleHandler

DefaultTitleHandler is the default function called to determine a song's name/artist from its content/filename.

Functions

func Play

func Play(glob string, radioDetails RadioDetails) (http.Handler, error)

Play returns an http.Handler that streams all files collected by glob indefinitely in order.

func SetTitleHandler

func SetTitleHandler(titleHandler func(*os.File) icy.TagData)

SetTitleHandler changes the function that is called to determine a song's name/artist from its content/filename.

func Shuffle

func Shuffle(glob string, radioDetails RadioDetails) (http.Handler, error)

Shuffle returns an http.Handler that streams all files collected by glob indefinitely in a randomized order.

Types

type RadioDetails

type RadioDetails = icy.RadioDetails

Directories

Path Synopsis
internal
icy

Jump to

Keyboard shortcuts

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