Skip to content

Add MP3/Opus audio export via mediabunny #291

@maboa

Description

@maboa

Background

The current WAV export uses a hand-rolled 16-bit PCM writer in js/audio-cut.js and produces large files. For sharing and archiving, MP3 or Opus is typically 10× smaller at acceptable quality. Mediabunny is a browser-side WebCodecs-based media library that supports encoding into MP3, Opus, AAC, FLAC, etc. — and reading/writing real containers (MP4, WebM, Ogg).

Proposed change

Extend the export modal with format options:

  • WAV — current behavior, universal fallback.
  • MP3 — via mediabunny.
  • Opus — via mediabunny.

Sensible defaults: MP3 at 192 kbps, Opus at 96 kbps.

Acceptance criteria

  • Export modal shows format selection (WAV / MP3 / Opus).
  • MP3 and Opus output is produced via mediabunny against the same section list used for WAV.
  • Output files play correctly in major browsers and standalone players.
  • Defaults are tuned to "good enough" without exposing bitrate controls (advanced controls covered separately).
  • Browsers without WebCodecs gracefully degrade (either disable MP3/Opus options with a tooltip, or warn before clicking).

Tradeoffs

  • WebCodecs is well-supported in Chrome/Edge, OK in Safari 16.4+, limited in Firefox.
  • Mediabunny adds bundle size (~roughly 100KB gzipped).

Out of scope

  • Video export (separate issue).
  • Bitrate / codec advanced controls (separate issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions