fixed error

This commit is contained in:
2026-04-09 01:50:19 -06:00
parent 1d17a8f19a
commit 140b7a5319
2 changed files with 126 additions and 54 deletions

View File

@ -122,13 +122,13 @@ async def get_waveform_audio(request: Request, path: str = Query(...)):
tmp_dir = tempfile.mkdtemp(prefix="talkedit_waveform_")
out_wav = Path(tmp_dir) / f"{cache_key}.wav"
# Downsample to mono 22050 Hz — enough for waveform drawing, small file
# Downsample to mono 8000 Hz — enough for waveform drawing and much smaller payloads
cmd = [
"ffmpeg", "-y",
"-i", str(file_path),
"-vn", # drop video
"-ac", "1", # mono
"-ar", "22050", # 22 kHz sample rate
"-ar", "8000", # 8 kHz sample rate
"-acodec", "pcm_s16le", # 16-bit PCM WAV
str(out_wav),
]