Files
teams-whisper/app/audio.py
pinokioandClaude Opus 5.5 4ff3e6fe14 Add Pinokio launcher for Teams meeting report pipeline
Pipeline code copied into app/; llama.py now uses launcher-local
llama.cpp (app/bin) and Qwen GGUF (app/models) instead of LM Studio.
install.js fetches ffmpeg, 7zip, llama.cpp CUDA 13, sherpa-onnx
diarization models, bge-m3 and Qwen3.6-35B-A3B, then pre-builds the
uv script environments. start.js serves the GUI on fixed port 18765
(hardcoded in the browser extension). reset.js keeps app/out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:29:33 +01:00

18 lines
881 B
Python

"""Cheap non-AI audio cleanup: mono 16k, highpass, loudnorm -> out/<name>/audio.opus."""
import subprocess
import db
def run(name):
src = db.media(name)[0]
if src is None: raise FileNotFoundError(f"no audio source for {name}")
dst = db.out_dir(name) / "audio.opus"
r = subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", str(src), "-vn", "-ac", "1", "-ar", "16000",
"-af", "highpass=f=80,loudnorm=I=-18:TP=-2:LRA=11", "-c:a", "libopus", "-b:a", "24k", str(dst)],
capture_output=True, text=True)
if r.returncode: raise RuntimeError(r.stderr[-500:])
d = subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", str(dst)],
capture_output=True, text=True, check=True).stdout.strip()
db.upsert_recording(name, duration_s=float(d))
return dst