fix(audio): expose sample rate setting in Convert Audio (#561)

The Convert Audio tool promised configurable bitrate, sample rate, and channel count, but only format and bitrate were exposed. Adds an optional sampleRate setting (8000 to 96000 Hz, omitted = preserve source) wired through the Zod schema, the FFmpeg -ar flag, the standalone settings panel, and the pipeline builder controls.

Impossible combinations fail loudly instead of degrading silently: MP3 + 96000 Hz is rejected (libmp3lame caps at 48 kHz), and MP3 bitrates above the encoder ceiling at low rates (64 kbps at 8 kHz, 160 kbps at 16/22.05 kHz) are rejected rather than clamped. The UI offers only legal combinations and sanitizes stored pipeline settings on load.

Docs updated in English plus all 20 localized pages with refreshed i18n_source_hash stamps; two new UI strings added to all 21 locales.

Fixes #558
This commit is contained in:
SnapOtter
2026-07-18 10:14:50 +08:00
committed by GitHub
parent 6ecc598fc4
commit d4eaa655b2
47 changed files with 541 additions and 133 deletions
@@ -795,6 +795,13 @@ const SETTINGS_VARIATIONS: Record<string, Variation[]> = {
{ label: "bitrate min", settings: { format: "mp3", bitrateKbps: 32 } },
{ label: "bitrate mid", settings: { format: "mp3", bitrateKbps: 128 } },
{ label: "bitrate max", settings: { format: "mp3", bitrateKbps: 320 } },
{ label: "sample rate min", settings: { format: "mp3", sampleRate: 8000, bitrateKbps: 64 } },
{ label: "sample rate 44100", settings: { format: "mp3", sampleRate: 44100 } },
{ label: "sample rate max mp3", settings: { format: "mp3", sampleRate: 48000 } },
{ label: "sample rate max wav", settings: { format: "wav", sampleRate: 96000 } },
{ label: "sample rate ogg", settings: { format: "ogg", sampleRate: 44100 } },
{ label: "sample rate m4a", settings: { format: "m4a", sampleRate: 96000 } },
{ label: "sample rate flac", settings: { format: "flac", sampleRate: 48000 } },
],
"trim-audio": [