Skip to content

Added opus support.#691

Open
sobmachine wants to merge 1 commit into
monochrome-music:mainfrom
sobmachine:main
Open

Added opus support.#691
sobmachine wants to merge 1 commit into
monochrome-music:mainfrom
sobmachine:main

Conversation

@sobmachine
Copy link
Copy Markdown

@sobmachine sobmachine commented Jun 4, 2026

Description

Type of Change

  • Bug fix
  • New feature
  • Style/UI update
  • Docs only

Checklist

  • I have read the Contributing Guidelines.
  • I understand every line of code I am submitting.
  • I have tested these changes locally, and they work as expected.
  • Is this Pull request Using AI/Is Vibecoded?

By submitting this PR, I agree to follow the guidelines. I understand that the final decision to merge rests with the maintainers and that not all contributions can be accepted.

Summary by CodeRabbit

  • New Features

    • Added Opus audio format support with five quality tiers (320, 256, 128, 160, 96 kbps).
    • Opus options now available in the download quality selection menu.
  • Tests

    • Added test coverage for Opus format downloads.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d370a7e3-faa6-4d4a-9c2a-c1ce08de5d3a

📥 Commits

Reviewing files that changed from the base of the PR and between b6c83c5 and 39064fd.

📒 Files selected for processing (3)
  • js/api.test.ts
  • js/ffmpegFormats.ts
  • js/settings.js

📝 Walkthrough

Walkthrough

This pull request adds support for downloading audio in Opus format at five different bitrate tiers. Changes span format definitions, download detection logic, test coverage, and UI sorting.

Changes

Opus Audio Format Support

Layer / File(s) Summary
Detection enum and validation
js/api.test.ts
Detection enum extended with OPUS_320, OPUS_256, OPUS_128, OPUS_160, OPUS_96 members. Validation switch expanded to confirm Opus downloads are OggFile instances with 48 kHz sample rate and expected bitrate per quality tier.
FFmpeg Opus format definitions
js/ffmpegFormats.ts
Five new customFormats entries (FFMPEG_OPUS_320/256/128/160/96) specify libopus encoder arguments, output filename output.opus, MIME type audio/opus, and extension/category mapping.
UI category ordering
js/settings.js
Download quality dropdown category sort order updated to include Opus category alongside existing audio format categories.
Download test cases
js/api.test.ts
test.each matrix extended with five Opus test cases mapping each quality tier to corresponding Detection.OPUS_* value and asserting single FFmpeg invocation per download.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • monochrome-music/monochrome#298: This PR's Opus format definitions and settings category handling build on the custom FFmpeg formats infrastructure introduced in that PR.

Suggested reviewers

  • JulienMaille

Poem

🐰 A rabbit's delight in formats so fine,
Five Opus tiers, each bitrate divine,
From three-twenty down to ninety-six low,
OggFiles and FFmpeg, a digital show! 🎵

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete; it only contains the checklist and type of change selection but provides no actual description of the changes or implementation details. Add a comprehensive description explaining what Opus support was added (e.g., which quality tiers, how it integrates with existing code), and why these changes were made.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Added opus support' directly and concisely summarizes the main change—adding Opus audio format support across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

js/api.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

js/ffmpegFormats.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

js/settings.js

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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