You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found by reading the code (not executed):DictationTranscriber.__init__ in assemblyai/dictation/v1/client.py defaults max_workers to max(1, os.cpu_count() - 1).
Every open_live() session submits _impl.transcribe_live to that pool and holds one worker thread for the entire recording, but the work is network I/O, not CPU. On a 1-2 vCPU container (small Cloud Run/Fargate/Lambda sizes, CI runners) the pool has one worker, so:
the second concurrent open_live() does not start its HTTP request until the first session completes (standard ThreadPoolExecutor queueing);
its write() calls only fill the in-memory queue, so all of its audio is uploaded late and its latency becomes the first dictation's full duration plus its own;
the server-side "upload went silent" timeout and 120 s cap only start counting once a session actually begins, so failures show up late and far from the cause.
Dictation backends serving several users at once are exactly the use case in the docs ("a telephony media stream", "a WebRTC track").
Suggested fix: default to an I/O-appropriate size such as min(32, (os.cpu_count() or 1) + 4) (what ThreadPoolExecutor itself uses), and/or warn when open_live() is called while all workers are busy. AsyncDictationTranscriber is unaffected.
Activity