GUI: Record-Button in Kopfzeile (Aufnahme-Tab entfernt) + Live-Karte; lame-Stille-Fix

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113vDKdSNtD3Dwcw4QMu9yV
This commit is contained in:
schakal00783
2026-07-17 02:18:39 +02:00
co-authored by Claude Fable 5
parent aef50dda64
commit b33b555fa7
4 changed files with 99 additions and 68 deletions
+12 -3
View File
@@ -308,9 +308,18 @@ export async function stopAndSave() {
const mp3Path = path.join(REC_DIR, `${base}.mp3`);
// Gentle cleanup for playback: cut low rumble + normalize loudness. Applied to
// the MP3 only; whisper still transcribes the untouched WAV.
await pexec('ffmpeg', ['-y', '-i', c.wavPath,
'-af', 'highpass=f=80,loudnorm=I=-16:TP=-1.5:LRA=11',
'-codec:a', 'libmp3lame', '-qscale:a', '3', mp3Path]);
// lame's psymodel asserts (`calc_energy: el >= 0`) on pure digital silence —
// real since the gated mic path: nobody spoke = all-zero samples. Fall back
// to a filterless encode instead of failing the whole stop.
try {
await pexec('ffmpeg', ['-y', '-i', c.wavPath,
'-af', 'highpass=f=80,loudnorm=I=-16:TP=-1.5:LRA=11',
'-codec:a', 'libmp3lame', '-qscale:a', '3', mp3Path]);
} catch (e) {
console.warn('mp3 encode with filters failed (silence?), retrying plain:', String(e.message).slice(0, 200));
await pexec('ffmpeg', ['-y', '-i', c.wavPath,
'-codec:a', 'libmp3lame', '-qscale:a', '3', mp3Path]);
}
// Move the wav into REC_DIR (rootfs — survives a reboot); it is NOT left in
// /tmp, so a crash during transcription can no longer lose it.