Skip to content

Add AIFF codec support for conversion - #1006

Open
chuckyutan wants to merge 2 commits into
nathom:devfrom
chuckyutan:add-aiff-codec
Open

Add AIFF codec support for conversion#1006
chuckyutan wants to merge 2 commits into
nathom:devfrom
chuckyutan:add-aiff-codec

Conversation

@chuckyutan

Copy link
Copy Markdown

What

Adds AIFF as a conversion target codec.

Currently [conversion] supports FLAC, ALAC, OPUS, MP3, VORBIS, and AAC. This adds AIFF (lossless PCM, pcm_s24be) so users can have downloads converted to .aiff — useful for DJ software and editing workflows (e.g. Serato, Logic, Pro Tools) that prefer AIFF.

Changes

  • converter.py: new AIFF converter class (pcm_s24be, container aiff, lossless) and registered "AIFF" in get()
  • rip/cli.py: allow --codec aiff and update help text
  • config.py / config.toml: document AIFF in the codec comment

Testing

Verified the underlying ffmpeg conversion produces a valid 24-bit AIFF:

$ ffprobe out.aiff
codec_name=pcm_s24be
sample_rate=44100
bits_per_raw_sample=24

🤖 Generated with Claude Code

Add an AIFF converter (lossless PCM, pcm_s24be) so downloads can be
converted to .aiff via the `[conversion]` codec option or `--codec aiff`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chuckyutan chuckyutan closed this Jun 24, 2026
Conversion runs after tagging the source file, but ffmpeg does not
reliably carry metadata into the converted container (AIFF was left
completely untagged). Add an AIFF tagging path (ID3 via mutagen) and
re-tag the converted file for formats tag_file understands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chuckyutan chuckyutan reopened this Jun 24, 2026
berettavexee pushed a commit to berettavexee/streamrip that referenced this pull request Aug 18, 2026
Cherry-picks upstream nathom#1006, adapted to the fork.

ffmpeg does not carry every field across a container change: measured on a
fully tagged FLAC source, it drops ISRC and lyrics when converting to MP3 or
ALAC, and writes no tags at all into AIFF. Track._convert now tags the
converted file again. Containers tag_file() cannot write (opus, ogg) are
skipped and keep whatever ffmpeg copied over, plus the cover the converter
embeds itself via _embed_cover_art.

Adapted from upstream:

- the list of taggable extensions is exported as TAGGABLE_EXTENSIONS from
  tagger.py rather than hardcoded in _convert, so it cannot drift from the
  dispatch in tag_file(); a test asserts the two agree
- embed_cover clears existing FLAC pictures before adding: add_picture()
  appends where ID3.add() and the MP4 "covr" assignment replace, so
  re-tagging a re-encoded FLAC embedded a second copy of the cover
- --codec validation keeps the fork's click.BadParameter
- converter.get() also accepts "AIF"

Tests: end-to-end ffmpeg round trips (skipped when ffmpeg is absent, as on
CI), the codec registry, Container.AIFF, and the extension gating in
_convert. Includes regression coverage that opus/ogg keep their cover art.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant