Commit Graph
85 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek fa4c7fe5e8 refac 2026-10-07 00:57:06 +04:00
Timothy Jaeryang Baek 093bfce2b6 refac 2026-10-07 00:39:16 +04:00
G30 7dd9fc7076 fix: stop the rest of the reply when interrupting Voice mode (#31876) (#31877) 2026-10-05 11:13:38 +04:00
G30 51da3eefc9 fix: set up the Kokoro voice when Voice Mode opens, however it was opened (#31829) 2026-10-01 20:24:06 +04:00
Classic298 7924ce7d79 fix: unhandled play() rejection wedges the Read Aloud button; auto-playback silent on iOS (#30373)
On iOS and iPadOS, auto-playback of a finished reply is never heard and the speaker button stays stuck in "speaking", so the first tap only stops a playback that never started. WebKit rejects play() started from a network event, and the audio queue ignored that rejection, so its state never reset. Call mode on the same devices was silent too.

A rejected play() now resets the queue, returns the button to idle and shows a toast (an aborted play from stop or a message switch is ignored). The first user tap or keypress plays a 10 ms silent clip on the shared audio element, which WebKit then allows to play later without a gesture; if that attempt fails it retries on the next gesture. Call mode plays unmuted: WebKit pauses an element that is unmuted after play() outside a gesture, even once unlocked.

The unlock and call mode change follow the reporter's on-device tests (iPhone iOS 27, iPad iPadOS 26.6.2). Verified in Chromium with autoplay restricted: the base queue wedges and drops later chunks; with the fix it reports the error, recovers, the unlock plays once and never interrupts audio already playing, and chunks queued during the unlock still play.

Fixes #30262
2026-09-23 23:52:09 -04:00
Classic298 869a5b1035 fix: stop voice mode listening after leaving the chat page (#30405) (#30417)
Leaving the chat with voice mode active (Admin Panel, Workspace, Notes) left a hidden recorder running in the tab. The voice mode flag stays on when the chat page unmounts, so the overlay's teardown restarted recording on the destroyed component, which kept transcribing speech and sending prompts from other pages. Returning to the chat also opened an extra microphone stream that was never closed.

The overlay now marks itself destroyed on teardown and never starts or restarts recording after that, so leaving the chat shuts the microphone down fully.

Resetting the voice mode flag in the chat page cleanup was considered, but it changes behaviour for the controls panel on return and still runs after the overlay's own teardown.

Verified in Chromium with a fake microphone (14s per phase, transcription requests / live mic tracks):

| Phase | before | after |
|---|---|---|
| Call on chat | 3 / 1 | 3 / 1 |
| After moving to Workspace | 3 / 1 | 0 / 0 |
| Voice mode reopened | 3 / 3 | 3 / 1 |

Fixes #30405
2026-09-23 23:30:30 -04:00
Classic298 24c01bd76d fix: stop voice call hanging in "speaking" when TTS fails (#30372)
When the configured TTS provider fails during a voice call, the text answer arrives but the overlay stays in "speaking" with no audio and no error until the user taps to interrupt. The sentence that failed never reaches the audio cache, so the playback loop re-queues it every 200 ms forever.

A failed sentence now marks its message as failed. The playback loop drops that message's unplayed sentences, the rest of the turn requests no more TTS, and the overlay returns to listening once the text finishes. The OpenAI-compatible path now shows the provider error once per turn, the same way Read Aloud and the Kokoro path already do. The next turn tries TTS again.

Failure is tracked per message so an outage (the report shows 16 parallel requests all failing) costs one toast and no further requests. The trade-off is that a one-off failure mutes the rest of that reply.

Verified with the real fetch/playback code in a harness: base loops forever with no toast; with the fix, one toast, the loop ends, later sentences are not requested, a new turn plays normally, and a late failure from a previous turn does not affect the next one.

Fixes #30052
2026-09-22 16:57:10 -04:00
Timothy Jaeryang Baek f677fdbf50 refac 2026-09-03 20:22:32 -04:00
Timothy Jaeryang Baek a4738e0459 refac 2026-08-25 12:45:12 -04:00
Classic298 18c604baa9 fix: voice mode produces no audio when the task model returns empty content (#28724)
With "show emoji in call" enabled, voice mode stayed completely silent and no request ever reached the configured TTS server. Reasoning models served with a reasoning parser return `message.content` as null and put the text in `reasoning_content`, and the emoji helper called `.replace()` on that null value and threw.

The call overlay ran the emoji request first, inside the same `try` block as speech synthesis, so that error skipped the entire TTS section. The audio cache was never filled, and the playback loop kept re-queueing the same content every 200 ms without ever playing it. Read aloud was unaffected because it synthesizes speech directly, which is why the failure looked specific to voice mode.

Fixed on both sides: the optional chain in `generateEmoji` now covers `content`, and the emoji request in the call overlay gets its own catch, matching the speech synthesis call directly below it. An emoji failure now costs the emoji instead of the whole reply.
2026-08-20 13:03:55 -07:00
Timothy Jaeryang Baek 89caa7c849 refac 2026-07-27 01:19:34 -04:00
Timothy Jaeryang Baek aedb6bef4e refac 2026-07-14 04:15:20 -04:00
Timothy Jaeryang Baek bf4f44ee9c refac 2026-05-09 05:27:47 +09:00
Timothy Jaeryang Baek 072d2000f3 refac 2026-05-09 04:53:47 +09:00
Timothy Jaeryang Baek 5c3edc2539 refac 2026-05-09 01:17:33 +09:00
Timothy Jaeryang Baek 636ba171a4 chore: format 2026-01-09 19:46:32 +04:00
Timothy Jaeryang Baek bb6188abf0 feat: per model tts voice 2026-01-09 19:05:09 +04:00
Timothy Jaeryang Baek 0eb1246c87 refac 2025-11-23 20:19:44 -05:00
Timothy Jaeryang Baek 6442871947 refac: profile_image_url optimization 2025-11-20 20:43:59 -05:00
Silentoplayz e3bacc3296 fix: Small fixes 2025-06-27 04:35:28 -04:00
Timothy Jaeryang Baek baaa285534 feat: user stt language 2025-05-24 00:36:30 +04:00
vincent-thevenin 4d6132b9de fix: fix issue with call voice recording starting before voice detection 2025-03-03 13:59:28 +01:00
Timothy Jaeryang Baek d95e5e0ba5 enh: kokorojs call support 2025-02-09 23:54:24 -08:00
Timothy Jaeryang Baek a863f98c53 refac: toast error 2025-01-20 22:41:32 -08:00
Timothy Jaeryang Baek 43964de675 refac: audio input 2025-01-02 02:32:51 -08:00
Timothy J. Baek 9ca2350a13 fix: call tts issue 2024-10-05 10:42:06 -07:00
Timothy J. Baek 1715446b13 fix: call mode persisting after width change issue 2024-09-26 21:45:19 +02:00
Timothy J. Baek 580ad46036 refac: speedRate -> playbackRate 2024-09-21 15:42:39 +02:00
Timothy J. Baek 2f028b45fe refac 2024-09-21 04:53:44 +02:00
Timothy J. Baek 2adaf9ba3d refac 2024-09-21 04:10:24 +02:00
Timothy J. Baek ff2fff857a refac: styling 2024-09-19 03:22:55 +02:00
Zohaib Rauf 91cd8c7608 Undid a unnecessary change 2024-09-09 21:59:13 -07:00
Zohaib Rauf 62b01c5f8e Cleaned up 2024-09-09 21:57:53 -07:00
Zohaib Rauf b33ab6c5fd Updated to use Dropdown menu which is being used elsewhere in app 2024-09-09 21:33:48 -07:00
Zohaib Rauf f88a86f9b0 Fixed build error 2024-09-08 22:57:33 -07:00
Timothy J. Baek 8dfbdbd883 fix: mic kept alive after call issue 2024-09-07 01:28:07 +01:00
Timothy J. Baek a9673c793a fix 2024-08-26 15:37:11 +02:00
Timothy J. Baek 8a99eaa68f fix 2024-08-23 18:21:19 +02:00
Timothy J. Baek 553293f4d5 refac: styling 2024-08-23 16:45:07 +02:00
Timothy J. Baek 48503573c1 refac: call overlay styling 2024-08-23 16:42:36 +02:00
Timothy J. Baek 153a2876b4 fix: mediaStream not stopping after exiting call mode 2024-08-22 17:27:22 +02:00
Timothy J. Baek c268a4e217 refac: only activate wakelock in call mode 2024-08-22 17:12:31 +02:00
Timothy J. Baek 7ef5aa520c chore: format 2024-08-13 11:12:35 +01:00
Timothy J. Baek c9f5029a9d refac 2024-07-08 23:07:23 -07:00
Timothy J. Baek d0f34baaa3 feat: voice interruption toggle 2024-06-22 13:21:36 -07:00
Timothy J. Baek f1b350cbe6 enh: use model profile image in call 2024-06-17 01:55:06 -07:00
Timothy J. Baek 54b65a89fd refac: call overlay 2024-06-16 21:52:50 -07:00
Timothy J. Baek 6d9ed32929 refac 2024-06-16 17:19:18 -07:00
Timothy J. Baek ad2ffc33d8 refac: voice call tap to interrupt 2024-06-16 16:50:57 -07:00
Timothy J. Baek 3de4c6189b fix: voice input sensitivity 2024-06-14 02:41:27 -07:00