Rockbox.Metadata (rockbox_ex_ffi v0.1.0)

Copy Markdown View Source

Audio file metadata / tag parsing.

Summary

Functions

Guess the codec label (e.g. "FLAC") from a filename's extension without opening the file. Returns nil for an unknown extension.

Parse the metadata of the audio file at path.

Same as read/1 but raises on error.

Functions

probe(filename)

@spec probe(String.t()) :: String.t() | nil

Guess the codec label (e.g. "FLAC") from a filename's extension without opening the file. Returns nil for an unknown extension.

read(path)

@spec read(Path.t()) :: {:ok, map()} | {:error, term()}

Parse the metadata of the audio file at path.

Returns {:ok, map} with atom keys (:codec, :title, :duration_ms, :sample_rate, a nested :replaygain map, …) or {:error, reason}.

read!(path)

@spec read!(Path.t()) :: map()

Same as read/1 but raises on error.