From 95e4cdf203fd098a4324f1fb8679201dc0e1f50a Mon Sep 17 00:00:00 2001 From: TRIP <1933142963@qq.com> Date: Mon, 6 Jul 2026 20:01:40 +0800 Subject: [PATCH] fix(audio-cue): recover when resume() is rejected or wakes non-running (#757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Long sessions park the shared AudioContext in 'suspended' / WebKit 'interrupted' after the system audio session is repeatedly preempted by ASR and recording. The earlier fix only recreated a 'closed' context: a rejected resume() was swallowed and a resume() that resolved without reaching 'running' scheduled voices on a frozen currentTime, both of which leave the start cue permanently silent until the app restarts. Treat both "won't wake" states as recoverable — discard the dead context and retry once on a fresh one, bounded to avoid infinite recreation. The decision is extracted into the pure, unit-tested cueActionAfterResume. Co-authored-by: sim