Skip to content
wittywillaPublic

About

WittyCD: CD images and an on-screen CD player for WittyMediaServer

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

66 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WittyCD

Plays images of audio CDs in WittyMediaServer the way a CD player does: one continuous program, with no gap between tracks. You need it if you keep CD images in a music or disc library. WittyMediaServer's site is https://wittymediaserver.com.

An audio CD image playing on the CD screen

A CD image authored for testing from Jazz Sampler, Kevin MacLeod, CC BY 3.0.

What it does

  • Reads images: .cue with .bin, .wav, .aiff or a single .flac; .toc; .ccd with .img; .nrg; .chd; and a bare .iso, .img or .bin that is really audio.
  • Knows the layout: tracks, indexes, pregaps, sessions, data tracks, pre-emphasis flags, ISRCs, the barcode, CD-TEXT and CD+G.
  • Plays without gaps. A disc is one stream, and track changes are places in it. Chosen tracks and repeats play the same way.
  • Streams FLAC or WAV. WAV takes no encoding. FLAC uses its own small encoder.
  • Corrects pre-emphasis on flagged tracks, and gives the same samples when you seek as when you play through.
  • Plays in a CD player. In the web app it brings its own CD player page, and the disc keeps playing with the bar along the bottom when you leave it.
  • Finds which album a disc is. An admin chooses from what MusicBrainz knows, in the CD player or, on a TV or phone, on the page Find this album. Only the disc's table of contents is sent; the server does the asking and fetches the cover, so the process that reads an image never has a network.
  • Reports problems. An image whose audio is scrambled shows up as noise and is reported, and so is a DTS surround disc. Nothing is decrypted or bypassed.

It doesn't read these:

  • Compressed audio other than a single FLAC (.mp3, .ape and so on). A sheet beside per-track FLAC files isn't treated as an image either, since those are tagged songs already.
  • Raw .sub files for CD+G. Use a .cdg file beside the image.
  • CD-TEXT in double-byte character sets, which is reported instead.

CCD and NRG are tested against images built to their published descriptions, not against dumps from the original programs. CHD and TOC are checked against the real tools.

How to use it is in Help inside WittyMediaServer: see Music, audiobooks and podcasts.

How it fits

WittyCD is a module of WittyMediaServer: a helper program the server starts to read images, with a part in the browser for the CD player. Asking MusicBrainz and fetching covers, the stream's FFmpeg conversion and how a library shows a disc stay with the server, so the process that reads an image never has a network.

How to get it

An admin adds it from the module store inside WittyMediaServer: Settings → Modules → Browse the store → Add beside WittyCD. This version is built for module API 5 and fits WittyMediaServer 0.8.0-alpha through 0.8.x (minServer and maxServer in module.json). A server takes module API 5 only, so nothing older works.

What it needs

  • WittyModule, which is how a server talks to it, built in, and its web kit to build the web part (npm run build:bundle, with WITTYMODULE naming a WittyModule checkout).
  • No music comes with it.

It's written in Go with no cgo, from the publicly described formats.

Platforms

A program is built for each system below, and the server uses the right one.

System Where it stands
Linux (x64, arm64, 32-bit ARM, x86) Its tests pass on x64. The other CPUs are only built
Windows (x64, arm64) Built. This version hasn't been run on Windows since it became its own program
macOS (Intel, Apple silicon) Built by the release tool. It has not been run on a real Mac
FreeBSD (amd64, arm64) Cross-compiled only. It has not been run

On macOS and FreeBSD the server has no sandbox for a module's helper: it gets a small environment and a soft memory limit, and nothing more.

Building and testing

You need Go 1.26 or newer. To build against the repositories checked out beside it, run the copy of dev-modules.mjs kept above the repositories first. It writes a go.work that git ignores, so the checkout builds against the repositories beside it. Never run go work use. Without one, go.mod's released versions are used, as in CI.

What CI runs:

go run github.com/wittywilla/wittymodule/cmd/wittymodule@v0.5.4 check .
go vet ./...
go test ./... -count=1
npm ci
npm test
npm run build:bundle

The first one checks the manifest. On the same tool, pack -targets linux/amd64 -out release . builds a release for one system. CI also builds for every system. npm run build:bundle needs a WittyModule checkout at ../WittyModule, or WITTYMODULE set to one.

To look at an image by hand:

go run ./cmd/wittycd info "Album.cue"
go run ./cmd/wittycd check "Album.cue"

info shows the structure. check reads the whole image and says what's wrong.

To use it as a library, wittycd.Open gives a Disc. NewStream, TrackStream and RangeStream give a stream readable at any offset by any number of readers, with WriteFLAC and WAV. TOC gives MusicBrainzID, LookupString and CDDBID. The lookup package asks MusicBrainz and the Cover Art Archive, and has an Attribution to show wherever the data is used.

Working on a Mac? Start with WittyMediaServer's MAC-START-HERE.md: what to install, what to clone, and every Mac task in order: this module's is item 7.1 (wittywilla/WittyMediaServer#571).

Licence

GNU Affero General Public License v3.0 (or later): see LICENSE and NOTICE. If you redistribute it or build on it, please keep the NOTICE attribution. It contains no code from GPL libraries. Disc IDs follow the method published by MusicBrainz, which isn't connected with this project. Each release archive carries a THIRD-PARTY-NOTICES.txt for what its programs link.

Releasing

A version tag builds a program for every platform, signs the checksum list, and publishes a release that servers can install.

Versions move in small steps as work lands. go run github.com/wittywilla/wittymodule/cmd/wittymodule@v0.5.4 bump . raises it everywhere it is written (add -part minor for a bigger step). A bump isn't a release: nothing is tagged or published until you tag it. CI fails when code changed since the last tag and the version didn't, because tags never move.

To release:

  1. Check that version in module.json is the one to publish, with the bump committed.
  2. Tag that commit and push the tag: git tag vX.Y.Z, then git push origin vX.Y.Z. A tag with a suffix, such as v1.2.0-beta, is published as a prerelease.
  3. Watch the Actions tab. The signing step uses the WMS_SIGNING_KEY secret of the release environment, and nothing is published without it.

To take a version back, run the withdraw workflow from the Actions tab. It adds the version to a signed list on the release tagged withdrawals, which servers read.

Licensed under AGPL-3.0-or-later: see LICENSE and NOTICE.

Legal

WittyCD is an independent open-source project. It isn't associated with, sponsored by or endorsed by the owners of the Compact Disc format, any record label or artist, or MusicBrainz. It isn't a licensed Compact Disc product and uses no disc logo. It reads CD images you already have: no music comes with it, and you're responsible for having the rights to what you open. Album details come from the MusicBrainz and Cover Art Archive services, which are asked only by a disc's table of contents. Any third-party names here only describe what it works with, and belong to their owners. It's provided “as is”, with no warranty; see LICENSE. Local law applies to how you use it. This isn't legal advice.

About

WittyCD: CD images and an on-screen CD player for WittyMediaServer

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages