Keep long recordings: spool, retry, chunked upload, progress ring
A long clip used to die on a fixed 30 s timeout and the audio went with it. Now every conditioned clip is written to spool/ before upload and only removed once its text is on the clipboard; failures keep it, and a tray item retries spooled clips (copied together, never dispatched). Requests the API rejects outright (4xx other than 408/429) are not kept. Timeouts scale with the audio (30 s + 30 s/min, capped at 5 min). Clips over 5 min are cut inside pauses into ~4 min chunks uploaded three at a time and stitched in order; failed chunks are spooled individually and the partial transcript is copied with a gap marker. The tray disc fills clockwise as chunks return. mic_check.py passes the new timeout tuple. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016rLFNPygDpRkRwPQakdmYh
This commit is contained in:
+3
-2
@@ -87,10 +87,11 @@ def main() -> None:
|
||||
print(f"\nNo {provider} key available; skipping transcription.")
|
||||
return
|
||||
print(f"\nTranscribing with {app.transcription_model} ({app.transcription_language})…")
|
||||
timeout = blurt.transcription_timeout(len(conditioned) / blurt.SAMPLE_RATE)
|
||||
result = (
|
||||
app._transcribe_openrouter(wav_bytes)
|
||||
app._transcribe_openrouter(wav_bytes, timeout)
|
||||
if provider == "openrouter"
|
||||
else app._transcribe_openai(wav_bytes)
|
||||
else app._transcribe_openai(wav_bytes, timeout)
|
||||
)
|
||||
print("\n--- transcript ---")
|
||||
print(result.get("text", result))
|
||||
|
||||
Reference in New Issue
Block a user