ws-cleanup: consistency (lower-case tags, WAVE channel order, loops = play count, Err messages, caps)

- Audio tags keys are lower case everywhere (Types.Tags): FLAC no longer returns TITLE / ARTIST (the raw fields stay
  in meta.source.comments; also for Vorbis and Opus); Vorbis / Opus / FLAC read and write tags through
  codecs/VorbisComment (TRACKNUMBER -> track, DISCNUMBER -> disc, DESCRIPTION -> comment); MP3 albumArtist ->
  albumartist and year -> date (ID3 TYER / TDRC, ID3v1); RIFF INFO / CAF / MP4 freeform names are lower-cased (MP4
  writes iTunSMPB / iTunNORM back in their usual spelling; m4a reads tags.itunsmpb).
- Channel order: Vorbis (and Opus mapping family 1) decode to WAVE order like FLAC / WAV / AAC (both used to return
  the Vorbis order); the Vorbis encoder takes WAVE order and writes Vorbis order. Pcm.WAVE_FROM_VORBIS / Pcm.reorder;
  Vorbis.packetDecoder gives pd.order. Tests reorder oggdec's / opusdec's raw (Vorbis-order) references.
- img.loops is the play count in GIF, APNG and WebP (they already agreed; Types / WebP docs said "loop count");
  tests/api round-trips loops 0 / 1 / 3 through all three.
- Err: messages without the format name (png / midi encoders said "png encode: ..."); codecs/Bzip2 and codecs/Zstd
  check arguments through Bytes.span.
- caps: mp3 encodeLayers = { 2, 3 }, opus encodeChannels = 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
4DBugandClaude Opus 5.5 committed 2026-10-31 11:01:22 -05:00
1 parent 8158acf3d5
commit fb2dd98db2
27 files changed
+164 -170

No files matched your search

+3 -3
View File
@@ -80,9 +80,9 @@ do
t:eq(back.meta.source.bitDepth, 8, "bit depth from meta.source")
-- (the absorbed FLAC decoder keeps Vorbis comment keys upper case)
local tags = back.tags :: any
t:eq(tags.title or tags.TITLE, "Tïtle", "title")
t:eq(tags.artist or tags.ARTIST, "Artist", "artist")
t:eq(tags.track or tags.TRACKNUMBER, "3", "track number")
t:eq(tags.title, "Tïtle", "title")
t:eq(tags.artist, "Artist", "artist")
t:eq(tags.track, "3", "track number")
local empty = Flac.encode(Types.Audio.new(44100, 2, 0)) :: buffer
local e0 = Flac.decode(Bytes.reader(empty))
t:check(e0 and e0.frames == 0, "empty audio")