mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(tts): let voice mode read replies aloud on iOS
iOS rejects play() outside a user gesture unless the same media element was already played inside one. Each chunk used a new Audio element, so replies in voice mode failed with "Reading the reply failed". - reuse one audio element for all external TTS playback - add tts.unlock(), which plays a short silent clip on that element, and call it from the voice mode start and orb taps - route every playback failure through failPlayback(message) and pass the message to onEnd so voice mode shows the underlying reason - report a blocked play() as "Audio playback was blocked by the browser"
This commit is contained in:
1 parent
10190940bd
commit
67cfd862b1
8 files changed
+354
-190
No files matched your search
@@ -48,6 +48,7 @@ vi.mock('@/hooks/useTTS', () => ({
|
||||
useTTS: () => ({
|
||||
speakMessage: vi.fn(),
|
||||
stop: vi.fn(),
|
||||
unlock: vi.fn(),
|
||||
isEnabled: false,
|
||||
isPlaying: false,
|
||||
isLoading: false,
|
||||
|
||||
Reference in new issue
Block a user