Preload audio as Blob for instant seeking; generate Opus playback file; delete original upload after extraction
Some checks failed
Build and Push / build (push) Has been cancelled
Some checks failed
Build and Push / build (push) Has been cancelled
- Download full audio as Blob on mount so seeking is instant (no network range-requests) - Remove readyState guard from playAt() that was silently blocking seek attempts - Add disabled/ready state to SessionReel for reliable click-to-seek - Generate 48kbps Opus playback file during extraction (~65MB for 3hrs vs 1.5GB lossless) - Serve Opus first in audio endpoint, then original upload, then extracted WAV - Delete original upload after successful transcription to reclaim storage - Reorder extract_audio checks so retry works without the original file - Fix Back links on Speakers and Notes pages to go to home
This commit is contained in:
@@ -84,13 +84,21 @@ def get_audio(session_id: str):
|
||||
if not row:
|
||||
raise HTTPException(404, "Session not found")
|
||||
|
||||
# Prefer the original uploaded file — it's a compressed format the browser
|
||||
# can seek in efficiently. Fall back to the extracted WAV.
|
||||
# Priority: Opus playback > original upload > extracted WAV.
|
||||
# The Opus file is tiny (~65 MB for 3 hours) so the frontend's Blob
|
||||
# download completes in seconds on any modern connection.
|
||||
candidates = []
|
||||
|
||||
if row["audio_path"]:
|
||||
opus = Path(row["audio_path"]).with_suffix(".opus")
|
||||
if opus.exists():
|
||||
candidates.append(opus)
|
||||
|
||||
if row["video_path"]:
|
||||
p = Path(row["video_path"])
|
||||
if p.exists():
|
||||
candidates.append(p)
|
||||
|
||||
if row["audio_path"]:
|
||||
p = Path(row["audio_path"])
|
||||
if p.exists():
|
||||
|
||||
Reference in New Issue
Block a user