monatone: Pure Haskell library for audio metadata parsing and writing

[ audio, gpl, library, program, sound ] [ Propose Tags ] [ Report a vulnerability ]

Monatone is a pure Haskell library for parsing and writing metadata from audio files. Supported formats include . - FLAC (full read/write support with Vorbis comments and album art) - MP3 (ID3v1, ID3v2.3, and ID3v2.4 tags including APIC frames for album art) - OGG/Vorbis (Vorbis comment reading) - Opus (basic metadata support) . Features include a pure Haskell implementation with no FFI dependencies, streaming support for large files, type-safe metadata representation, and comprehensive tag writing support for both FLAC and MP3 formats.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies aeson (>=2.1 && <2.4), base (>=4.17 && <5), base64-bytestring (>=1.2 && <1.3), binary (>=0.8 && <0.9), bytestring (>=0.11 && <0.13), containers (>=0.6 && <0.9), deepseq (>=1.4 && <1.6), directory (>=1.3 && <1.4), file-io (>=0.1 && <0.2), filepath (>=1.4 && <1.6), monatone, mtl (>=2.2 && <2.4), text (>=2.1 && <2.2), unordered-containers (>=0.2 && <0.3) [details]
Tested with ghc ==9.10.3
License GPL-3.0-only
Author rembo10
Maintainer rembo10@users.noreply.github.com
Category Audio, Sound
Home page https://github.com/rembo10/monatone
Bug tracker https://github.com/rembo10/monatone/issues
Source repo head: git clone https://github.com/rembo10/monatone
Uploaded by rembo10 at 2025-11-14T02:58:08Z
Distributions
Executables monatone
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-11-14 [all 1 reports]

Readme for monatone-0.1.0.0

[back to package description]

Monatone

A pure Haskell library for parsing and writing audio metadata.

Features

  • Pure Haskell - No FFI dependencies or external binaries required
  • Multiple format support - FLAC, MP3 (ID3v1/v2), OGG/Vorbis, and Opus
  • Read and write - Full tag writing support for FLAC and MP3
  • Type-safe - Strongly typed metadata representation
  • Efficient - Streaming support for large files

Installation

cabal install monatone

Or add to your .cabal file:

build-depends: monatone >= 0.1.0

Quick Start

import Monatone.FLAC (parseMetadata)
import Monatone.Metadata

-- Parse metadata from a FLAC file
main :: IO ()
main = do
  result <- parseMetadata "song.flac"
  case result of
    Left err -> putStrLn $ "Error: " ++ show err
    Right metadata -> do
      putStrLn $ "Title: " ++ maybe "Unknown" id (title metadata)
      putStrLn $ "Artist: " ++ maybe "Unknown" id (artist metadata) 
      putStrLn $ "Album: " ++ maybe "Unknown" id (album metadata)

Supported Formats

FLAC

  • Full Vorbis comment support (read/write)
  • PICTURE block support for album art
  • StreamInfo parsing for audio properties

MP3

  • ID3v1 tag support (read/write)
  • ID3v2.3 and ID3v2.4 support (read/write)
  • APIC frame support for album art
  • Common frames: TIT2, TPE1, TALB, TYER, TCON, etc.

OGG/Vorbis

  • Vorbis comment reading
  • Basic metadata extraction

Opus

  • Basic metadata support through Vorbis comments

Writing Tags

import Monatone.Writer
import Monatone.Types
import qualified Data.Map as Map

-- Update MP3 tags
updateMP3Tags :: FilePath -> IO ()
updateMP3Tags file = do
  let tags = Map.fromList
        [ ("TIT2", "New Title")
        , ("TPE1", "New Artist")
        , ("TALB", "New Album")
        ]
  result <- writeMP3Tags file tags
  case result of
    Left err -> putStrLn $ "Error: " ++ err
    Right () -> putStrLn "Tags updated successfully"

API Documentation

Full API documentation is available on Hackage.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests on GitHub.

License

GPL 3.0 License - see LICENSE file for details.