@celljs/ta-web 4.27.0 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-role.d.ts +9 -4
- package/esm/browser/assistant/assistant-role.js +17 -5
- package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
- package/esm/browser/assistant/assistant-task-util.js +12 -1
- package/esm/browser/assistant/assistant-thread.js +15 -2
- package/esm/browser/assistant/assistant-view.js +4 -1
- package/esm/browser/assistant/assistant.d.ts +2 -1
- package/esm/browser/assistant/assistant.js +9 -7
- package/esm/browser/assistant/call-conversing.d.ts +45 -0
- package/esm/browser/assistant/call-conversing.js +91 -0
- package/esm/browser/assistant/call-face.d.ts +13 -0
- package/esm/browser/assistant/call-face.js +81 -0
- package/esm/browser/assistant/call-keeper.d.ts +8 -4
- package/esm/browser/assistant/call-keeper.js +32 -11
- package/esm/browser/assistant/call-partnering.d.ts +37 -0
- package/esm/browser/assistant/call-partnering.js +79 -0
- package/esm/browser/assistant/call-scenes.d.ts +26 -0
- package/esm/browser/assistant/call-scenes.js +85 -0
- package/esm/browser/assistant/call-screen.d.ts +3 -0
- package/esm/browser/assistant/call-screen.js +15 -0
- package/esm/browser/assistant/mic-sense.d.ts +31 -0
- package/esm/browser/assistant/mic-sense.js +119 -0
- package/esm/browser/assistant/noise-gate.d.ts +32 -0
- package/esm/browser/assistant/noise-gate.js +66 -0
- package/esm/browser/assistant/pcm-util.d.ts +10 -0
- package/esm/browser/assistant/pcm-util.js +55 -0
- package/esm/browser/assistant/read-aloud.d.ts +2 -1
- package/esm/browser/assistant/realtime-voice-protocol.d.ts +84 -0
- package/esm/browser/assistant/realtime-voice-protocol.js +40 -0
- package/esm/browser/assistant/realtime-voice.d.ts +50 -62
- package/esm/browser/assistant/realtime-voice.js +213 -134
- package/esm/browser/assistant/spoken-timeline.d.ts +27 -0
- package/esm/browser/assistant/spoken-timeline.js +49 -0
- package/esm/browser/assistant/voice-call-bar.d.ts +9 -2
- package/esm/browser/assistant/voice-call-bar.js +81 -31
- package/esm/browser/assistant/voice-call-protocol.d.ts +61 -4
- package/esm/browser/assistant/voice-call.d.ts +16 -23
- package/esm/browser/assistant/voice-call.js +134 -117
- package/esm/browser/assistant/voice-reading.d.ts +83 -0
- package/esm/browser/assistant/voice-reading.js +150 -0
- package/esm/browser/avatar/dino-talk.d.ts +15 -0
- package/esm/browser/avatar/dino-talk.js +34 -0
- package/esm/browser/chat/chat-protocol.d.ts +2 -0
- package/esm/browser/chat/chat-shown.d.ts +3 -1
- package/esm/browser/chat/chat-shown.js +25 -3
- package/esm/browser/chat/chat.d.ts +5 -1
- package/esm/browser/chat/chat.js +32 -16
- package/esm/browser/components/account-menu.d.ts +6 -16
- package/esm/browser/components/account-menu.js +47 -101
- package/esm/browser/components/app-contexts.js +3 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-protocol.d.ts +2 -0
- package/esm/browser/components/composer-box.js +20 -1
- package/esm/browser/components/composer-emoji.d.ts +22 -0
- package/esm/browser/components/composer-emoji.js +50 -0
- package/esm/browser/components/conversation-scroll-util.d.ts +8 -1
- package/esm/browser/components/conversation-scroll-util.js +21 -0
- package/esm/browser/components/conversation-scroll.js +10 -11
- package/esm/browser/components/discover-view.d.ts +4 -3
- package/esm/browser/components/discover-view.js +5 -4
- package/esm/browser/components/emoji-panel.d.ts +22 -0
- package/esm/browser/components/emoji-panel.js +54 -0
- package/esm/browser/components/gallery.js +28 -7
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/image-pull.d.ts +64 -0
- package/esm/browser/components/image-pull.js +202 -0
- package/esm/browser/components/kept-call-bar.js +2 -1
- package/esm/browser/components/lightbox.d.ts +1 -1
- package/esm/browser/components/lightbox.js +57 -2
- package/esm/browser/components/markdown.d.ts +8 -1
- package/esm/browser/components/markdown.js +12 -4
- package/esm/browser/components/me-rows.d.ts +24 -0
- package/esm/browser/components/me-rows.js +19 -0
- package/esm/browser/components/me-view.d.ts +2 -1
- package/esm/browser/components/me-view.js +3 -2
- package/esm/browser/components/message-list.js +47 -7
- package/esm/browser/components/message-steps.js +13 -0
- package/esm/browser/components/nav-places.js +1 -1
- package/esm/browser/components/partner-row.js +2 -1
- package/esm/browser/components/relay-services.d.ts +9 -3
- package/esm/browser/components/relay-services.js +73 -35
- package/esm/browser/components/session-view.js +4 -2
- package/esm/browser/components/settings-choices.js +3 -0
- package/esm/browser/components/settings-controls.d.ts +13 -0
- package/esm/browser/components/settings-controls.js +19 -0
- package/esm/browser/components/settings-more.d.ts +1 -1
- package/esm/browser/components/settings-more.js +28 -39
- package/esm/browser/components/settings-parts.d.ts +4 -2
- package/esm/browser/components/settings-parts.js +16 -9
- package/esm/browser/components/settings-view.js +2 -6
- package/esm/browser/components/ta-avatar.d.ts +15 -1
- package/esm/browser/components/ta-avatar.js +38 -5
- package/esm/browser/components/voice-services.js +6 -1
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/device/file-save.d.ts +31 -0
- package/esm/browser/device/file-save.js +80 -0
- package/esm/browser/extension/extension-view.d.ts +2 -0
- package/esm/browser/extension/extension-view.js +2 -0
- package/esm/browser/extension/web-api-call.d.ts +109 -2
- package/esm/browser/extension/web-api-components.d.ts +4 -0
- package/esm/browser/extension/web-api-contributions.d.ts +14 -14
- package/esm/browser/extension/web-api-desktop.d.ts +16 -1
- package/esm/browser/extension/web-api-desktop.js +1 -0
- package/esm/browser/extension/web-api-partners.d.ts +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +8 -10
- package/esm/browser/extension/web-extension-code.d.ts +15 -8
- package/esm/browser/extension/web-extension-code.js +25 -27
- package/esm/browser/extension/web-extension-context.js +4 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +10 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +4 -2
- package/esm/browser/extension/web-extension-run.js +10 -4
- package/esm/browser/extension/web-extensions-running.js +7 -6
- package/esm/browser/extension/web-pages.d.ts +2 -0
- package/esm/browser/extension/web-pages.js +2 -0
- package/esm/browser/i18n/en/account.d.ts +202 -0
- package/esm/browser/i18n/en/account.js +205 -0
- package/esm/browser/i18n/en/assistant.d.ts +129 -0
- package/esm/browser/i18n/en/assistant.js +130 -0
- package/esm/browser/i18n/en/call.d.ts +86 -0
- package/esm/browser/i18n/en/call.js +87 -0
- package/esm/browser/i18n/en/chat.d.ts +213 -0
- package/esm/browser/i18n/en/chat.js +214 -0
- package/esm/browser/i18n/en/common.d.ts +99 -0
- package/esm/browser/i18n/en/common.js +101 -0
- package/esm/browser/i18n/en/console.d.ts +230 -0
- package/esm/browser/i18n/en/console.js +232 -0
- package/esm/browser/i18n/en/discover.d.ts +117 -0
- package/esm/browser/i18n/en/discover.js +119 -0
- package/esm/browser/i18n/en/service.d.ts +242 -0
- package/esm/browser/i18n/en/service.js +245 -0
- package/esm/browser/i18n/en/settings.d.ts +213 -0
- package/esm/browser/i18n/en/settings.js +214 -0
- package/esm/browser/i18n/en/tools.d.ts +85 -0
- package/esm/browser/i18n/en/tools.js +87 -0
- package/esm/browser/i18n/ja/account.d.ts +2 -0
- package/esm/browser/i18n/ja/account.js +202 -0
- package/esm/browser/i18n/ja/assistant.d.ts +2 -0
- package/esm/browser/i18n/ja/assistant.js +129 -0
- package/esm/browser/i18n/ja/call.d.ts +2 -0
- package/esm/browser/i18n/ja/call.js +86 -0
- package/esm/browser/i18n/ja/chat.d.ts +2 -0
- package/esm/browser/i18n/ja/chat.js +213 -0
- package/esm/browser/i18n/ja/common.d.ts +2 -0
- package/esm/browser/i18n/ja/common.js +99 -0
- package/esm/browser/i18n/ja/console.d.ts +2 -0
- package/esm/browser/i18n/ja/console.js +230 -0
- package/esm/browser/i18n/ja/discover.d.ts +2 -0
- package/esm/browser/i18n/ja/discover.js +117 -0
- package/esm/browser/i18n/ja/service.d.ts +2 -0
- package/esm/browser/i18n/ja/service.js +242 -0
- package/esm/browser/i18n/ja/settings.d.ts +2 -0
- package/esm/browser/i18n/ja/settings.js +213 -0
- package/esm/browser/i18n/ja/tools.d.ts +2 -0
- package/esm/browser/i18n/ja/tools.js +85 -0
- package/esm/browser/i18n/locales.d.ts +1150 -1131
- package/esm/browser/i18n/messages-ja.js +20 -1567
- package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/esm/browser/i18n/messages-zh-tw.js +20 -1568
- package/esm/browser/i18n/messages.d.ts +1153 -1131
- package/esm/browser/i18n/messages.js +44 -3145
- package/esm/browser/i18n/zh/account.d.ts +2 -0
- package/esm/browser/i18n/zh/account.js +203 -0
- package/esm/browser/i18n/zh/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh/assistant.js +129 -0
- package/esm/browser/i18n/zh/call.d.ts +2 -0
- package/esm/browser/i18n/zh/call.js +86 -0
- package/esm/browser/i18n/zh/chat.d.ts +2 -0
- package/esm/browser/i18n/zh/chat.js +213 -0
- package/esm/browser/i18n/zh/common.d.ts +2 -0
- package/esm/browser/i18n/zh/common.js +99 -0
- package/esm/browser/i18n/zh/console.d.ts +2 -0
- package/esm/browser/i18n/zh/console.js +230 -0
- package/esm/browser/i18n/zh/discover.d.ts +2 -0
- package/esm/browser/i18n/zh/discover.js +117 -0
- package/esm/browser/i18n/zh/service.d.ts +2 -0
- package/esm/browser/i18n/zh/service.js +242 -0
- package/esm/browser/i18n/zh/settings.d.ts +2 -0
- package/esm/browser/i18n/zh/settings.js +213 -0
- package/esm/browser/i18n/zh/tools.d.ts +2 -0
- package/esm/browser/i18n/zh/tools.js +86 -0
- package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/account.js +202 -0
- package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/assistant.js +129 -0
- package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/call.js +86 -0
- package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/chat.js +213 -0
- package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/common.js +99 -0
- package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/console.js +230 -0
- package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +117 -0
- package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/service.js +242 -0
- package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/settings.js +213 -0
- package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/tools.js +85 -0
- package/esm/browser/markdown/code-renderers.d.ts +2 -0
- package/esm/browser/markdown/code-renderers.js +2 -0
- package/esm/browser/offline/device-values.d.ts +4 -0
- package/esm/browser/offline/device-values.js +10 -0
- package/esm/browser/pwa/page-build.d.ts +15 -0
- package/esm/browser/pwa/page-build.js +45 -0
- package/esm/browser/screen/page-answers.d.ts +2 -1
- package/esm/browser/screen/page-answers.js +7 -4
- package/esm/browser/settings/settings-protocol.d.ts +4 -0
- package/esm/browser/settings/settings-protocol.js +4 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +3 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +1 -1
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +17 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +11 -1
- package/esm/browser/style/device.js +1 -0
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +1 -1
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +135 -57
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +0 -7
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +8 -0
- package/esm/browser/style/video-call.d.ts +2 -0
- package/esm/browser/style/video-call.js +63 -0
- package/esm/browser/style.js +2 -0
- package/esm/browser/util/call-transcript.d.ts +16 -0
- package/esm/browser/util/call-transcript.js +110 -0
- package/esm/browser/util/desktop.d.ts +10 -1
- package/esm/browser/util/desktop.js +10 -0
- package/esm/browser/util/image-pull.d.ts +61 -0
- package/esm/browser/util/image-pull.js +88 -0
- package/esm/browser/util/process.d.ts +6 -0
- package/esm/browser/util/process.js +18 -5
- package/esm/browser/util/spoken.d.ts +3 -3
- package/esm/browser/util/spoken.js +4 -4
- package/esm/browser/video-call/call-camera.d.ts +59 -0
- package/esm/browser/video-call/call-camera.js +188 -0
- package/esm/browser/video-call/call-people.d.ts +21 -0
- package/esm/browser/video-call/call-people.js +29 -0
- package/esm/browser/video-call/call-window.d.ts +19 -0
- package/esm/browser/video-call/call-window.js +80 -0
- package/esm/browser/video-call/clip-plan.d.ts +56 -0
- package/esm/browser/video-call/clip-plan.js +76 -0
- package/esm/browser/video-call/face-camera.d.ts +93 -0
- package/esm/browser/video-call/face-camera.js +192 -0
- package/esm/browser/video-call/face-files.d.ts +69 -0
- package/esm/browser/video-call/face-files.js +132 -0
- package/esm/browser/video-call/face-moves.d.ts +68 -0
- package/esm/browser/video-call/face-moves.js +180 -0
- package/esm/browser/video-call/face-stage.d.ts +139 -0
- package/esm/browser/video-call/face-stage.js +219 -0
- package/esm/browser/video-call/mouth-layer.d.ts +81 -0
- package/esm/browser/video-call/mouth-layer.js +241 -0
- package/esm/browser/video-call/video-call-view.d.ts +19 -0
- package/esm/browser/video-call/video-call-view.js +254 -0
- package/esm/browser/video-call/video-face.d.ts +19 -0
- package/esm/browser/video-call/video-face.js +471 -0
- package/esm/browser/workbench-hosts.d.ts +1 -0
- package/esm/browser/workbench-protocol.d.ts +2 -0
- package/esm/browser/workbench-util.d.ts +5 -0
- package/esm/browser/workbench-util.js +18 -0
- package/esm/browser/workbench.d.ts +14 -0
- package/esm/browser/workbench.js +73 -6
- package/lib/browser/assistant/assistant-role.d.ts +9 -4
- package/lib/browser/assistant/assistant-role.js +17 -5
- package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
- package/lib/browser/assistant/assistant-task-util.js +11 -0
- package/lib/browser/assistant/assistant-thread.js +15 -2
- package/lib/browser/assistant/assistant-view.js +3 -0
- package/lib/browser/assistant/assistant.d.ts +2 -1
- package/lib/browser/assistant/assistant.js +9 -7
- package/lib/browser/assistant/call-conversing.d.ts +46 -0
- package/lib/browser/assistant/call-conversing.js +96 -0
- package/lib/browser/assistant/call-face.d.ts +14 -0
- package/lib/browser/assistant/call-face.js +117 -0
- package/lib/browser/assistant/call-keeper.d.ts +8 -4
- package/lib/browser/assistant/call-keeper.js +32 -11
- package/lib/browser/assistant/call-partnering.d.ts +38 -0
- package/lib/browser/assistant/call-partnering.js +83 -0
- package/lib/browser/assistant/call-scenes.d.ts +27 -0
- package/lib/browser/assistant/call-scenes.js +88 -0
- package/lib/browser/assistant/call-screen.d.ts +3 -0
- package/lib/browser/assistant/call-screen.js +15 -0
- package/lib/browser/assistant/mic-sense.d.ts +32 -0
- package/lib/browser/assistant/mic-sense.js +123 -0
- package/lib/browser/assistant/noise-gate.d.ts +33 -0
- package/lib/browser/assistant/noise-gate.js +71 -0
- package/lib/browser/assistant/pcm-util.d.ts +11 -0
- package/lib/browser/assistant/pcm-util.js +58 -0
- package/lib/browser/assistant/read-aloud.d.ts +2 -1
- package/lib/browser/assistant/realtime-voice-protocol.d.ts +85 -0
- package/lib/browser/assistant/realtime-voice-protocol.js +43 -0
- package/lib/browser/assistant/realtime-voice.d.ts +50 -62
- package/lib/browser/assistant/realtime-voice.js +217 -138
- package/lib/browser/assistant/spoken-timeline.d.ts +28 -0
- package/lib/browser/assistant/spoken-timeline.js +53 -0
- package/lib/browser/assistant/voice-call-bar.d.ts +9 -2
- package/lib/browser/assistant/voice-call-bar.js +81 -30
- package/lib/browser/assistant/voice-call-protocol.d.ts +61 -4
- package/lib/browser/assistant/voice-call.d.ts +16 -23
- package/lib/browser/assistant/voice-call.js +134 -117
- package/lib/browser/assistant/voice-reading.d.ts +84 -0
- package/lib/browser/assistant/voice-reading.js +156 -0
- package/lib/browser/avatar/dino-talk.d.ts +16 -0
- package/lib/browser/avatar/dino-talk.js +37 -0
- package/lib/browser/chat/chat-protocol.d.ts +2 -0
- package/lib/browser/chat/chat-shown.d.ts +3 -1
- package/lib/browser/chat/chat-shown.js +25 -3
- package/lib/browser/chat/chat.d.ts +5 -1
- package/lib/browser/chat/chat.js +32 -16
- package/lib/browser/components/account-menu.d.ts +6 -16
- package/lib/browser/components/account-menu.js +45 -99
- package/lib/browser/components/app-contexts.js +2 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-protocol.d.ts +2 -0
- package/lib/browser/components/composer-box.js +20 -1
- package/lib/browser/components/composer-emoji.d.ts +23 -0
- package/lib/browser/components/composer-emoji.js +87 -0
- package/lib/browser/components/conversation-scroll-util.d.ts +8 -1
- package/lib/browser/components/conversation-scroll-util.js +21 -0
- package/lib/browser/components/conversation-scroll.js +10 -11
- package/lib/browser/components/discover-view.d.ts +4 -3
- package/lib/browser/components/discover-view.js +5 -4
- package/lib/browser/components/emoji-panel.d.ts +23 -0
- package/lib/browser/components/emoji-panel.js +90 -0
- package/lib/browser/components/gallery.js +28 -7
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/image-pull.d.ts +65 -0
- package/lib/browser/components/image-pull.js +206 -0
- package/lib/browser/components/kept-call-bar.js +2 -1
- package/lib/browser/components/lightbox.d.ts +1 -1
- package/lib/browser/components/lightbox.js +57 -2
- package/lib/browser/components/markdown.d.ts +8 -1
- package/lib/browser/components/markdown.js +11 -3
- package/lib/browser/components/me-rows.d.ts +25 -0
- package/lib/browser/components/me-rows.js +22 -0
- package/lib/browser/components/me-view.d.ts +2 -1
- package/lib/browser/components/me-view.js +3 -2
- package/lib/browser/components/message-list.js +46 -6
- package/lib/browser/components/message-steps.js +13 -0
- package/lib/browser/components/nav-places.js +1 -1
- package/lib/browser/components/partner-row.js +2 -1
- package/lib/browser/components/relay-services.d.ts +9 -3
- package/lib/browser/components/relay-services.js +71 -33
- package/lib/browser/components/session-view.js +3 -1
- package/lib/browser/components/settings-choices.js +3 -0
- package/lib/browser/components/settings-controls.d.ts +13 -0
- package/lib/browser/components/settings-controls.js +19 -0
- package/lib/browser/components/settings-more.d.ts +1 -1
- package/lib/browser/components/settings-more.js +27 -38
- package/lib/browser/components/settings-parts.d.ts +4 -2
- package/lib/browser/components/settings-parts.js +15 -8
- package/lib/browser/components/settings-view.js +2 -6
- package/lib/browser/components/ta-avatar.d.ts +15 -1
- package/lib/browser/components/ta-avatar.js +38 -5
- package/lib/browser/components/voice-services.js +5 -0
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/device/file-save.d.ts +32 -0
- package/lib/browser/device/file-save.js +83 -0
- package/lib/browser/extension/extension-view.d.ts +2 -0
- package/lib/browser/extension/extension-view.js +3 -1
- package/lib/browser/extension/web-api-call.d.ts +109 -2
- package/lib/browser/extension/web-api-components.d.ts +4 -0
- package/lib/browser/extension/web-api-contributions.d.ts +14 -14
- package/lib/browser/extension/web-api-desktop.d.ts +16 -1
- package/lib/browser/extension/web-api-desktop.js +1 -0
- package/lib/browser/extension/web-api-partners.d.ts +2 -0
- package/lib/browser/extension/web-extension-api.d.ts +8 -10
- package/lib/browser/extension/web-extension-code.d.ts +15 -8
- package/lib/browser/extension/web-extension-code.js +25 -27
- package/lib/browser/extension/web-extension-context.js +4 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +10 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +4 -2
- package/lib/browser/extension/web-extension-run.js +10 -4
- package/lib/browser/extension/web-extensions-running.js +7 -6
- package/lib/browser/extension/web-pages.d.ts +2 -0
- package/lib/browser/extension/web-pages.js +2 -0
- package/lib/browser/i18n/en/account.d.ts +203 -0
- package/lib/browser/i18n/en/account.js +208 -0
- package/lib/browser/i18n/en/assistant.d.ts +130 -0
- package/lib/browser/i18n/en/assistant.js +133 -0
- package/lib/browser/i18n/en/call.d.ts +87 -0
- package/lib/browser/i18n/en/call.js +90 -0
- package/lib/browser/i18n/en/chat.d.ts +214 -0
- package/lib/browser/i18n/en/chat.js +217 -0
- package/lib/browser/i18n/en/common.d.ts +100 -0
- package/lib/browser/i18n/en/common.js +104 -0
- package/lib/browser/i18n/en/console.d.ts +231 -0
- package/lib/browser/i18n/en/console.js +235 -0
- package/lib/browser/i18n/en/discover.d.ts +118 -0
- package/lib/browser/i18n/en/discover.js +122 -0
- package/lib/browser/i18n/en/service.d.ts +243 -0
- package/lib/browser/i18n/en/service.js +248 -0
- package/lib/browser/i18n/en/settings.d.ts +214 -0
- package/lib/browser/i18n/en/settings.js +217 -0
- package/lib/browser/i18n/en/tools.d.ts +86 -0
- package/lib/browser/i18n/en/tools.js +90 -0
- package/lib/browser/i18n/ja/account.d.ts +3 -0
- package/lib/browser/i18n/ja/account.js +205 -0
- package/lib/browser/i18n/ja/assistant.d.ts +3 -0
- package/lib/browser/i18n/ja/assistant.js +132 -0
- package/lib/browser/i18n/ja/call.d.ts +3 -0
- package/lib/browser/i18n/ja/call.js +89 -0
- package/lib/browser/i18n/ja/chat.d.ts +3 -0
- package/lib/browser/i18n/ja/chat.js +216 -0
- package/lib/browser/i18n/ja/common.d.ts +3 -0
- package/lib/browser/i18n/ja/common.js +102 -0
- package/lib/browser/i18n/ja/console.d.ts +3 -0
- package/lib/browser/i18n/ja/console.js +233 -0
- package/lib/browser/i18n/ja/discover.d.ts +3 -0
- package/lib/browser/i18n/ja/discover.js +120 -0
- package/lib/browser/i18n/ja/service.d.ts +3 -0
- package/lib/browser/i18n/ja/service.js +245 -0
- package/lib/browser/i18n/ja/settings.d.ts +3 -0
- package/lib/browser/i18n/ja/settings.js +216 -0
- package/lib/browser/i18n/ja/tools.d.ts +3 -0
- package/lib/browser/i18n/ja/tools.js +88 -0
- package/lib/browser/i18n/locales.d.ts +1150 -1131
- package/lib/browser/i18n/messages-ja.js +20 -1567
- package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/lib/browser/i18n/messages-zh-tw.js +20 -1568
- package/lib/browser/i18n/messages.d.ts +1153 -1131
- package/lib/browser/i18n/messages.js +44 -3145
- package/lib/browser/i18n/zh/account.d.ts +3 -0
- package/lib/browser/i18n/zh/account.js +206 -0
- package/lib/browser/i18n/zh/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh/assistant.js +132 -0
- package/lib/browser/i18n/zh/call.d.ts +3 -0
- package/lib/browser/i18n/zh/call.js +89 -0
- package/lib/browser/i18n/zh/chat.d.ts +3 -0
- package/lib/browser/i18n/zh/chat.js +216 -0
- package/lib/browser/i18n/zh/common.d.ts +3 -0
- package/lib/browser/i18n/zh/common.js +102 -0
- package/lib/browser/i18n/zh/console.d.ts +3 -0
- package/lib/browser/i18n/zh/console.js +233 -0
- package/lib/browser/i18n/zh/discover.d.ts +3 -0
- package/lib/browser/i18n/zh/discover.js +120 -0
- package/lib/browser/i18n/zh/service.d.ts +3 -0
- package/lib/browser/i18n/zh/service.js +245 -0
- package/lib/browser/i18n/zh/settings.d.ts +3 -0
- package/lib/browser/i18n/zh/settings.js +216 -0
- package/lib/browser/i18n/zh/tools.d.ts +3 -0
- package/lib/browser/i18n/zh/tools.js +89 -0
- package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/account.js +205 -0
- package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/assistant.js +132 -0
- package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/call.js +89 -0
- package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/chat.js +216 -0
- package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/common.js +102 -0
- package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/console.js +233 -0
- package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/discover.js +120 -0
- package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/service.js +245 -0
- package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/settings.js +216 -0
- package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/tools.js +88 -0
- package/lib/browser/markdown/code-renderers.d.ts +2 -0
- package/lib/browser/markdown/code-renderers.js +3 -1
- package/lib/browser/offline/device-values.d.ts +4 -0
- package/lib/browser/offline/device-values.js +10 -0
- package/lib/browser/pwa/page-build.d.ts +16 -0
- package/lib/browser/pwa/page-build.js +48 -0
- package/lib/browser/screen/page-answers.d.ts +2 -1
- package/lib/browser/screen/page-answers.js +7 -4
- package/lib/browser/settings/settings-protocol.d.ts +4 -0
- package/lib/browser/settings/settings-protocol.js +4 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +3 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +1 -1
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +17 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +11 -1
- package/lib/browser/style/device.js +1 -0
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +1 -1
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +135 -57
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +0 -7
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +8 -0
- package/lib/browser/style/video-call.d.ts +3 -0
- package/lib/browser/style/video-call.js +66 -0
- package/lib/browser/style.js +2 -0
- package/lib/browser/util/call-transcript.d.ts +17 -0
- package/lib/browser/util/call-transcript.js +113 -0
- package/lib/browser/util/desktop.d.ts +10 -1
- package/lib/browser/util/desktop.js +10 -0
- package/lib/browser/util/image-pull.d.ts +62 -0
- package/lib/browser/util/image-pull.js +91 -0
- package/lib/browser/util/process.d.ts +6 -0
- package/lib/browser/util/process.js +17 -4
- package/lib/browser/util/spoken.d.ts +3 -3
- package/lib/browser/util/spoken.js +4 -4
- package/lib/browser/video-call/call-camera.d.ts +60 -0
- package/lib/browser/video-call/call-camera.js +192 -0
- package/lib/browser/video-call/call-people.d.ts +22 -0
- package/lib/browser/video-call/call-people.js +32 -0
- package/lib/browser/video-call/call-window.d.ts +20 -0
- package/lib/browser/video-call/call-window.js +83 -0
- package/lib/browser/video-call/clip-plan.d.ts +57 -0
- package/lib/browser/video-call/clip-plan.js +80 -0
- package/lib/browser/video-call/face-camera.d.ts +94 -0
- package/lib/browser/video-call/face-camera.js +197 -0
- package/lib/browser/video-call/face-files.d.ts +70 -0
- package/lib/browser/video-call/face-files.js +137 -0
- package/lib/browser/video-call/face-moves.d.ts +69 -0
- package/lib/browser/video-call/face-moves.js +184 -0
- package/lib/browser/video-call/face-stage.d.ts +140 -0
- package/lib/browser/video-call/face-stage.js +223 -0
- package/lib/browser/video-call/mouth-layer.d.ts +82 -0
- package/lib/browser/video-call/mouth-layer.js +245 -0
- package/lib/browser/video-call/video-call-view.d.ts +20 -0
- package/lib/browser/video-call/video-call-view.js +290 -0
- package/lib/browser/video-call/video-face.d.ts +20 -0
- package/lib/browser/video-call/video-face.js +507 -0
- package/lib/browser/workbench-hosts.d.ts +1 -0
- package/lib/browser/workbench-protocol.d.ts +2 -0
- package/lib/browser/workbench-util.d.ts +5 -0
- package/lib/browser/workbench-util.js +18 -0
- package/lib/browser/workbench.d.ts +14 -0
- package/lib/browser/workbench.js +71 -4
- package/package.json +7 -7
- package/public/faces/README.md +40 -0
- package/public/faces/blonde/clap.mp4 +0 -0
- package/public/faces/blonde/dance.mp4 +0 -0
- package/public/faces/blonde/face.jpg +0 -0
- package/public/faces/blonde/happy.mp4 +0 -0
- package/public/faces/blonde/heart.mp4 +0 -0
- package/public/faces/blonde/idle-1.mp4 +0 -0
- package/public/faces/blonde/idle-2.mp4 +0 -0
- package/public/faces/blonde/idle-3.mp4 +0 -0
- package/public/faces/blonde/laugh.mp4 +0 -0
- package/public/faces/blonde/listening.mp4 +0 -0
- package/public/faces/blonde/poster.jpg +0 -0
- package/public/faces/blonde/shy.mp4 +0 -0
- package/public/faces/blonde/sorry.mp4 +0 -0
- package/public/faces/blonde/stretch.mp4 +0 -0
- package/public/faces/blonde/surprised.mp4 +0 -0
- package/public/faces/blonde/talk-1.mp4 +0 -0
- package/public/faces/blonde/talk-2.mp4 +0 -0
- package/public/faces/blonde/think-2.mp4 +0 -0
- package/public/faces/blonde/thinking.mp4 +0 -0
- package/public/faces/blonde/wave.mp4 +0 -0
- package/public/faces/clap.mp4 +0 -0
- package/public/faces/dance.mp4 +0 -0
- package/public/faces/face.jpg +0 -0
- package/public/faces/framing.json +1 -0
- package/public/faces/happy.mp4 +0 -0
- package/public/faces/heart.mp4 +0 -0
- package/public/faces/idle-1.mp4 +0 -0
- package/public/faces/idle-2.mp4 +0 -0
- package/public/faces/idle-3.mp4 +0 -0
- package/public/faces/laugh.mp4 +0 -0
- package/public/faces/lips.json +1 -0
- package/public/faces/listening.mp4 +0 -0
- package/public/faces/poster.jpg +0 -0
- package/public/faces/shy.mp4 +0 -0
- package/public/faces/sorry.mp4 +0 -0
- package/public/faces/stretch.mp4 +0 -0
- package/public/faces/surprised.mp4 +0 -0
- package/public/faces/talk-1.mp4 +0 -0
- package/public/faces/talk-2.mp4 +0 -0
- package/public/faces/think-2.mp4 +0 -0
- package/public/faces/thinking.mp4 +0 -0
- package/public/faces/wave.mp4 +0 -0
|
@@ -12,6 +12,7 @@ import { DeviceMedia } from '../device/device-protocol.js';
|
|
|
12
12
|
import { ScreenAwake } from '../device/screen-awake.js';
|
|
13
13
|
import { TaState } from '../state/state-protocol.js';
|
|
14
14
|
import { DesktopUtil } from '../util/desktop.js';
|
|
15
|
+
import { CallWindow } from '../video-call/call-window.js';
|
|
15
16
|
export const TaCallKeeper = Symbol('TaCallKeeper');
|
|
16
17
|
export var CallKeeperUtil;
|
|
17
18
|
(function (CallKeeperUtil) {
|
|
@@ -28,7 +29,13 @@ export var CallKeeperUtil;
|
|
|
28
29
|
var _a;
|
|
29
30
|
const call = value;
|
|
30
31
|
return call && typeof call.sessionId === 'string' && typeof call.at === 'number'
|
|
31
|
-
? {
|
|
32
|
+
? {
|
|
33
|
+
sessionId: call.sessionId,
|
|
34
|
+
double: call.double === true,
|
|
35
|
+
title: String((_a = call.title) !== null && _a !== void 0 ? _a : ''),
|
|
36
|
+
...(call.video ? { video: true } : {}),
|
|
37
|
+
at: call.at,
|
|
38
|
+
}
|
|
32
39
|
: undefined;
|
|
33
40
|
},
|
|
34
41
|
};
|
|
@@ -68,7 +75,7 @@ export var CallKeeperUtil;
|
|
|
68
75
|
/** The call noted, if it went on lately enough to call again. */
|
|
69
76
|
function resumable(noted, now) {
|
|
70
77
|
return noted && now - noted.at >= 0 && now - noted.at <= CallKeeperUtil.RESUME_MS
|
|
71
|
-
? { sessionId: noted.sessionId, double: noted.double, title: noted.title }
|
|
78
|
+
? { sessionId: noted.sessionId, double: noted.double, title: noted.title, ...(noted.video ? { video: true } : {}) }
|
|
72
79
|
: undefined;
|
|
73
80
|
}
|
|
74
81
|
CallKeeperUtil.resumable = resumable;
|
|
@@ -105,8 +112,16 @@ let TaCallKeeperImpl = class TaCallKeeperImpl {
|
|
|
105
112
|
}
|
|
106
113
|
}
|
|
107
114
|
begin(call) {
|
|
108
|
-
|
|
109
|
-
if ((
|
|
115
|
+
const current = this.current;
|
|
116
|
+
if ((current === null || current === void 0 ? void 0 : current.held.call) === call.held.call) {
|
|
117
|
+
// Its conversation took its own id (one loaded again is known by its file until it loads), or a new title.
|
|
118
|
+
if (current.sessionId !== call.sessionId || current.title !== call.title) {
|
|
119
|
+
this.current = { ...current, sessionId: call.sessionId, title: call.title };
|
|
120
|
+
this.noteKept();
|
|
121
|
+
this.sharedAs = undefined;
|
|
122
|
+
this.share(this.current);
|
|
123
|
+
this.changed();
|
|
124
|
+
}
|
|
110
125
|
return;
|
|
111
126
|
}
|
|
112
127
|
this.watch(call);
|
|
@@ -123,7 +138,7 @@ let TaCallKeeperImpl = class TaCallKeeperImpl {
|
|
|
123
138
|
(_b = this.offShown) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
124
139
|
// As the view did: another app in front or the screen locked, the call waits.
|
|
125
140
|
const voice = call.held.call;
|
|
126
|
-
const shown = () => (
|
|
141
|
+
const shown = () => (CallWindow.hidden() ? voice.pause() : voice.resume());
|
|
127
142
|
if (typeof document !== 'undefined') {
|
|
128
143
|
document.addEventListener('visibilitychange', shown);
|
|
129
144
|
window.addEventListener('pagehide', shown);
|
|
@@ -155,10 +170,10 @@ let TaCallKeeperImpl = class TaCallKeeperImpl {
|
|
|
155
170
|
resume(sessionId, double) {
|
|
156
171
|
const before = this.resuming;
|
|
157
172
|
if (!before || (before.double ? !double : before.sessionId !== sessionId)) {
|
|
158
|
-
return
|
|
173
|
+
return undefined;
|
|
159
174
|
}
|
|
160
175
|
this.before = null;
|
|
161
|
-
return
|
|
176
|
+
return before;
|
|
162
177
|
}
|
|
163
178
|
hangUp() {
|
|
164
179
|
const kept = this.current;
|
|
@@ -185,8 +200,7 @@ let TaCallKeeperImpl = class TaCallKeeperImpl {
|
|
|
185
200
|
this.current = call;
|
|
186
201
|
this.notedAt = 0;
|
|
187
202
|
this.sharedAs = undefined;
|
|
188
|
-
|
|
189
|
-
noted();
|
|
203
|
+
this.noteKept();
|
|
190
204
|
this.share(call);
|
|
191
205
|
this.offState = voice.subscribe(() => {
|
|
192
206
|
var _a;
|
|
@@ -201,13 +215,20 @@ let TaCallKeeperImpl = class TaCallKeeperImpl {
|
|
|
201
215
|
}
|
|
202
216
|
if (voice.state.paused || Date.now() - this.notedAt >= CallKeeperUtil.NOTE_MS) {
|
|
203
217
|
// As the page goes to the background, where it may be closed, and now and then while it goes on.
|
|
204
|
-
|
|
218
|
+
this.noteKept();
|
|
205
219
|
}
|
|
206
|
-
this.share(
|
|
220
|
+
this.share(this.current);
|
|
207
221
|
});
|
|
208
222
|
before === null || before === void 0 ? void 0 : before.held.call.hangUp();
|
|
209
223
|
this.changed();
|
|
210
224
|
}
|
|
225
|
+
/** Notes the call going on now, as it is. */
|
|
226
|
+
noteKept() {
|
|
227
|
+
const kept = this.current;
|
|
228
|
+
if (kept) {
|
|
229
|
+
this.note({ sessionId: kept.sessionId, double: kept.double, title: kept.title, ...(kept.held.call.state.video ? { video: true } : {}) });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
211
232
|
/** Notes the call going on, for the page that loads next (resuming); undefined once it is over. */
|
|
212
233
|
note(spot) {
|
|
213
234
|
var _a;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CallDraft, CallOptions, CallPartner, CallState } from './voice-call-protocol.js';
|
|
2
|
+
/** What of a call (VoiceCall) its partner answers in. */
|
|
3
|
+
export interface PartneredCall {
|
|
4
|
+
/** Of the call now: what comes for a call hung up is let go. */
|
|
5
|
+
readonly calls: number;
|
|
6
|
+
readonly state: CallState;
|
|
7
|
+
set(change: Partial<CallState>): void;
|
|
8
|
+
/** The answer to say, as a turn's is. */
|
|
9
|
+
turnEnded(reply: string | undefined): void;
|
|
10
|
+
/** What the user said did not go: Ta listens again. */
|
|
11
|
+
unsent(): void;
|
|
12
|
+
announce(text: string): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Who answers in a call in place of the conversation (CallOptions.openPartner, docs/design/ta-call.md): it is asked
|
|
16
|
+
* what the user said, opened again once when it does not answer, and given way to the conversation when it cannot.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CallPartnering {
|
|
19
|
+
protected readonly call: PartneredCall;
|
|
20
|
+
protected readonly options: CallOptions;
|
|
21
|
+
partner?: CallPartner;
|
|
22
|
+
constructor(call: PartneredCall, options: CallOptions);
|
|
23
|
+
/** The partner of the call now: what it says by itself is said as news is, in a silence, and cut into as any answer. */
|
|
24
|
+
adopt(partner: CallPartner | undefined): void;
|
|
25
|
+
close(): void;
|
|
26
|
+
/** A partner opened for a voice service to answer, which does not: one that answers itself takes its place. */
|
|
27
|
+
unvoice(): void;
|
|
28
|
+
/** The partner answers what the user said; its reply is read as a turn's is. */
|
|
29
|
+
ask(text: string, sent?: boolean): void;
|
|
30
|
+
/** The user was done with the words of the draft: its answer is the reply; failing, the partner is asked as usual. */
|
|
31
|
+
kept(draft: CallDraft, said: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* The partner did not answer (the Ta service restarted, its side of the call is gone): it opens again once and
|
|
34
|
+
* answers what was said; failing that, the conversation answers from then on. The call goes on either way.
|
|
35
|
+
*/
|
|
36
|
+
protected reopen(failed: CallPartner, text: string, sent?: boolean): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who answers in a call in place of the conversation (CallOptions.openPartner, docs/design/ta-call.md): it is asked
|
|
3
|
+
* what the user said, opened again once when it does not answer, and given way to the conversation when it cannot.
|
|
4
|
+
*/
|
|
5
|
+
export class CallPartnering {
|
|
6
|
+
constructor(call, options) {
|
|
7
|
+
this.call = call;
|
|
8
|
+
this.options = options;
|
|
9
|
+
}
|
|
10
|
+
/** The partner of the call now: what it says by itself is said as news is, in a silence, and cut into as any answer. */
|
|
11
|
+
adopt(partner) {
|
|
12
|
+
var _a;
|
|
13
|
+
const calls = this.call.calls;
|
|
14
|
+
this.partner = partner;
|
|
15
|
+
(_a = partner === null || partner === void 0 ? void 0 : partner.news) === null || _a === void 0 ? void 0 : _a.call(partner, text => calls === this.call.calls && this.call.announce(text));
|
|
16
|
+
this.call.set({ partnered: !!partner });
|
|
17
|
+
}
|
|
18
|
+
close() {
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = this.partner) === null || _a === void 0 ? void 0 : _a.close();
|
|
21
|
+
this.partner = undefined;
|
|
22
|
+
}
|
|
23
|
+
/** A partner opened for a voice service to answer, which does not: one that answers itself takes its place. */
|
|
24
|
+
unvoice() {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
if (!((_a = this.partner) === null || _a === void 0 ? void 0 : _a.brain)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const calls = this.call.calls;
|
|
30
|
+
this.close();
|
|
31
|
+
void ((_d = (_c = (_b = this.options).openPartner) === null || _c === void 0 ? void 0 : _c.call(_b, true)) === null || _d === void 0 ? void 0 : _d.then(partner => (calls === this.call.calls && this.call.state.active ? this.adopt(partner) : partner === null || partner === void 0 ? void 0 : partner.close()), () => calls === this.call.calls && this.call.set({ partnered: false })));
|
|
32
|
+
}
|
|
33
|
+
/** The partner answers what the user said; its reply is read as a turn's is. */
|
|
34
|
+
ask(text, sent) {
|
|
35
|
+
const calls = this.call.calls;
|
|
36
|
+
const partner = this.partner;
|
|
37
|
+
partner === null || partner === void 0 ? void 0 : partner.say(text, sent ? { sent } : undefined).then(reply => calls === this.call.calls && this.call.turnEnded(reply), () => calls === this.call.calls && this.call.state.active && this.reopen(partner, text, sent));
|
|
38
|
+
}
|
|
39
|
+
/** The user was done with the words of the draft: its answer is the reply; failing, the partner is asked as usual. */
|
|
40
|
+
kept(draft, said) {
|
|
41
|
+
const calls = this.call.calls;
|
|
42
|
+
const partner = this.partner;
|
|
43
|
+
draft.keep();
|
|
44
|
+
draft.reply.then(reply => calls === this.call.calls && this.call.turnEnded(reply), () => calls === this.call.calls && this.call.state.active && this.partner === partner && this.ask(said));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The partner did not answer (the Ta service restarted, its side of the call is gone): it opens again once and
|
|
48
|
+
* answers what was said; failing that, the conversation answers from then on. The call goes on either way.
|
|
49
|
+
*/
|
|
50
|
+
reopen(failed, text, sent) {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
var _d;
|
|
53
|
+
const calls = this.call.calls;
|
|
54
|
+
if (this.partner !== failed) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.close();
|
|
58
|
+
const again = (_d = (_c = (_b = (_a = this.options).openPartner) === null || _b === void 0 ? void 0 : _b.call(_a, true)) === null || _c === void 0 ? void 0 : _c.catch(() => undefined)) !== null && _d !== void 0 ? _d : Promise.resolve(undefined);
|
|
59
|
+
void again.then(partner => {
|
|
60
|
+
if (calls !== this.call.calls || !this.call.state.active) {
|
|
61
|
+
partner === null || partner === void 0 ? void 0 : partner.close();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (!partner) {
|
|
65
|
+
this.call.set({ partnered: false });
|
|
66
|
+
if (sent) {
|
|
67
|
+
this.call.unsent();
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.options.send(text).catch(() => this.call.state.active && this.call.unsent());
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
this.adopt(partner);
|
|
75
|
+
partner.say(text, sent ? { sent } : undefined).then(reply => calls === this.call.calls && this.call.turnEnded(reply), () => calls === this.call.calls && this.call.state.active && this.call.unsent());
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=call-partnering.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type TaCallOwnMove, type TaCallScene, type TaCallView } from '@celljs/ta-protocol';
|
|
2
|
+
import type { VoiceCall } from './voice-call.js';
|
|
3
|
+
/** What the view of a call shows of it now (VideoCallView): the user's camera, how the call shows, what she can do (VideoFace). */
|
|
4
|
+
interface Shown {
|
|
5
|
+
camera?: boolean;
|
|
6
|
+
view?: TaCallView;
|
|
7
|
+
moves?: TaCallOwnMove[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* How a call is for the user (TaCallScene, docs/design/ta-call.md 13), from the call (video or voice, when it began),
|
|
11
|
+
* the device and what its view shows (the camera, full screen or small): given to the partner as the call opens and as
|
|
12
|
+
* it changes, and to the conversation itself in a direct call. The words are TaCallSceneUtil's alone.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace CallScenes {
|
|
15
|
+
function of(call: VoiceCall, device: TaCallScene['device']): TaCallScene;
|
|
16
|
+
/** The view of the call shows this now (what it names; the rest as it was). */
|
|
17
|
+
function show(call: VoiceCall, part: Shown): void;
|
|
18
|
+
/** Tells `changed` the scene of `call` as it changes and stays so a moment; until what it returns is called. */
|
|
19
|
+
function watch(call: VoiceCall, device: TaCallScene['device'], changed: (scene: TaCallScene) => void): () => void;
|
|
20
|
+
/**
|
|
21
|
+
* What a direct call tells the conversation with what the user said (SpokenReply.asked): what is new of the call
|
|
22
|
+
* since it last told it (TaCallSceneUtil.next). The conversation sees no picture of the camera.
|
|
23
|
+
*/
|
|
24
|
+
function next(call: VoiceCall, device: TaCallScene['device']): string | undefined;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TaCallSceneUtil } from '@celljs/ta-protocol';
|
|
2
|
+
/** How long the scene must stay before it is told: a window that only passes (full, then small) is not. */
|
|
3
|
+
const SETTLE_MS = 800;
|
|
4
|
+
/**
|
|
5
|
+
* How a call is for the user (TaCallScene, docs/design/ta-call.md 13), from the call (video or voice, when it began),
|
|
6
|
+
* the device and what its view shows (the camera, full screen or small): given to the partner as the call opens and as
|
|
7
|
+
* it changes, and to the conversation itself in a direct call. The words are TaCallSceneUtil's alone.
|
|
8
|
+
*/
|
|
9
|
+
export var CallScenes;
|
|
10
|
+
(function (CallScenes) {
|
|
11
|
+
const shown = new WeakMap();
|
|
12
|
+
const listeners = new WeakMap();
|
|
13
|
+
/** What a direct call told its conversation, of the call that began then. */
|
|
14
|
+
const told = new WeakMap();
|
|
15
|
+
function of(call, device) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const { camera, view, moves } = (_a = shown.get(call)) !== null && _a !== void 0 ? _a : {};
|
|
18
|
+
return {
|
|
19
|
+
video: call.state.video === true,
|
|
20
|
+
...(call.state.video && camera ? { camera } : {}),
|
|
21
|
+
...(call.state.video && view ? { view } : {}),
|
|
22
|
+
...(device ? { device } : {}),
|
|
23
|
+
since: (_b = call.state.since) !== null && _b !== void 0 ? _b : Date.now(),
|
|
24
|
+
...(call.state.video && (moves === null || moves === void 0 ? void 0 : moves.length) ? { moves } : {}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
CallScenes.of = of;
|
|
28
|
+
/** The view of the call shows this now (what it names; the rest as it was). */
|
|
29
|
+
function show(call, part) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const before = (_a = shown.get(call)) !== null && _a !== void 0 ? _a : {};
|
|
32
|
+
const now = { ...before, ...part };
|
|
33
|
+
const key = (value) => JSON.stringify([value.camera, value.view, value.moves]);
|
|
34
|
+
if (key(before) === key(now)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
shown.set(call, now);
|
|
38
|
+
for (const listener of [...((_b = listeners.get(call)) !== null && _b !== void 0 ? _b : [])]) {
|
|
39
|
+
listener();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
CallScenes.show = show;
|
|
43
|
+
/** Tells `changed` the scene of `call` as it changes and stays so a moment; until what it returns is called. */
|
|
44
|
+
function watch(call, device, changed) {
|
|
45
|
+
var _a;
|
|
46
|
+
let last = TaCallSceneUtil.key(of(call, device));
|
|
47
|
+
let timer;
|
|
48
|
+
const look = () => {
|
|
49
|
+
clearTimeout(timer);
|
|
50
|
+
timer = setTimeout(() => {
|
|
51
|
+
const scene = of(call, device);
|
|
52
|
+
const key = TaCallSceneUtil.key(scene);
|
|
53
|
+
if (call.state.active && key !== last) {
|
|
54
|
+
last = key;
|
|
55
|
+
changed(scene);
|
|
56
|
+
}
|
|
57
|
+
}, SETTLE_MS);
|
|
58
|
+
};
|
|
59
|
+
const own = (_a = listeners.get(call)) !== null && _a !== void 0 ? _a : new Set();
|
|
60
|
+
listeners.set(call, own);
|
|
61
|
+
own.add(look);
|
|
62
|
+
const offCall = call.subscribe(look);
|
|
63
|
+
return () => {
|
|
64
|
+
clearTimeout(timer);
|
|
65
|
+
own.delete(look);
|
|
66
|
+
offCall();
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
CallScenes.watch = watch;
|
|
70
|
+
/**
|
|
71
|
+
* What a direct call tells the conversation with what the user said (SpokenReply.asked): what is new of the call
|
|
72
|
+
* since it last told it (TaCallSceneUtil.next). The conversation sees no picture of the camera.
|
|
73
|
+
*/
|
|
74
|
+
function next(call, device) {
|
|
75
|
+
const scene = of(call, device);
|
|
76
|
+
let was = told.get(call);
|
|
77
|
+
if ((was === null || was === void 0 ? void 0 : was.since) !== scene.since) {
|
|
78
|
+
was = { since: scene.since, told: {} };
|
|
79
|
+
told.set(call, was);
|
|
80
|
+
}
|
|
81
|
+
return TaCallSceneUtil.next(scene, was.told, false, Date.now());
|
|
82
|
+
}
|
|
83
|
+
CallScenes.next = next;
|
|
84
|
+
})(CallScenes || (CallScenes = {}));
|
|
85
|
+
//# sourceMappingURL=call-scenes.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Mood } from '../avatar/dino-avatar.js';
|
|
1
2
|
import type { Translate } from '../i18n/use-t.js';
|
|
2
3
|
import { type ScreenPartSpec, type TaScreen } from '../screen/screen-protocol.js';
|
|
3
4
|
import type { CallPhase } from './voice-call-protocol.js';
|
|
@@ -32,6 +33,8 @@ export declare namespace CallScreen {
|
|
|
32
33
|
}
|
|
33
34
|
/** What the call is at, as its bar says. */
|
|
34
35
|
function phase(t: Translate, seen: Pick<Seen, 'phase' | 'paused' | 'heard'>): string;
|
|
36
|
+
/** How Ta's face looks for what the call is at (CallFace). */
|
|
37
|
+
function mood(seen: Pick<Seen, 'phase' | 'paused'>): Mood;
|
|
35
38
|
/** Presses the button of an action of the call where it shows, as the user would; else does what it does. */
|
|
36
39
|
function press(screen: Pick<TaScreen, 'element'>, name: string, otherwise: () => void): void;
|
|
37
40
|
/** The part of the screen of the call: its state in a line, and what its buttons do now. */
|
|
@@ -24,6 +24,21 @@ export var CallScreen;
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
CallScreen.phase = phase;
|
|
27
|
+
/** How Ta's face looks for what the call is at (CallFace). */
|
|
28
|
+
function mood(seen) {
|
|
29
|
+
if (seen.paused) {
|
|
30
|
+
return 'sleeping';
|
|
31
|
+
}
|
|
32
|
+
switch (seen.phase) {
|
|
33
|
+
case 'speaking':
|
|
34
|
+
return 'speaking';
|
|
35
|
+
case 'listening':
|
|
36
|
+
return 'listening';
|
|
37
|
+
default:
|
|
38
|
+
return 'thinking';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
CallScreen.mood = mood;
|
|
27
42
|
/** Presses the button of an action of the call where it shows, as the user would; else does what it does. */
|
|
28
43
|
function press(screen, name, otherwise) {
|
|
29
44
|
const button = screen.element(CallScreen.PART, undefined, name);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TaBargeIn } from '@celljs/ta-protocol';
|
|
2
|
+
import { type Doubt } from './realtime-voice-protocol.js';
|
|
3
|
+
/** What a piece of the microphone is (MicSense.measure). */
|
|
4
|
+
export interface MicPiece {
|
|
5
|
+
/** How loud (RMS, 0 to 1). */
|
|
6
|
+
level: number;
|
|
7
|
+
/** Periodic at the pitch of a voice: a vowel of someone speaking, not a cough, a knock, a fan. */
|
|
8
|
+
voiced: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What the microphone hears, piece by piece (docs/design/ta-voice.md 10): whether a piece is voiced, and the floor of
|
|
12
|
+
* the room, as minimum statistics do: it falls at once to a quieter piece, and rises only to what is not voiced (a fan,
|
|
13
|
+
* the hum of a room), so that the user speaking on and on never becomes the room.
|
|
14
|
+
*/
|
|
15
|
+
export declare class MicSense {
|
|
16
|
+
/** The floor of the room: the quietest it was lately, of what is not speech. */
|
|
17
|
+
floor: number;
|
|
18
|
+
measure(samples: Float32Array, rate: number): MicPiece;
|
|
19
|
+
/**
|
|
20
|
+
* A piece of the microphone while Ta reads and a sound may be the user cutting in (docs/design/ta-voice.md 10):
|
|
21
|
+
* voiced speech louder than `speech` in a run (gaps under GAP_MS) lowers the reading after DUCK_MS ('duck') and cuts
|
|
22
|
+
* in after speechMs ('cut'), unless it is no louder than `echo` (Ta's own voice heard back). What is not voiced (a
|
|
23
|
+
* cough, a knock) only counts as a gap.
|
|
24
|
+
*/
|
|
25
|
+
static weigh(doubt: Doubt, piece: MicPiece, ms: number, speech: number, echo: number, barge: TaBargeIn): 'duck' | 'cut' | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* How periodic `samples` are at the pitch of a voice: the highest normalized autocorrelation over the lags of
|
|
28
|
+
* PITCH_LOW to PITCH_HIGH, on samples averaged down to about VOICING_RATE; 0 for silence or noise, near 1 for a vowel.
|
|
29
|
+
*/
|
|
30
|
+
static voicing(samples: Float32Array, rate: number): number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { PcmUtil } from './pcm-util.js';
|
|
2
|
+
import { DUCK_MS, GAP_MS } from './realtime-voice-protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* How fast the floor of the room rises, a step of 100 ms, to a piece louder than it that is not voiced: a fan turned on
|
|
5
|
+
* is the room in about two seconds. A voiced piece (someone speaking) never raises it.
|
|
6
|
+
*/
|
|
7
|
+
const RISE = 1.15;
|
|
8
|
+
/** The floor as a call begins: a quiet room, until the microphone says otherwise. */
|
|
9
|
+
const FLOOR = 0.003;
|
|
10
|
+
/** Normalized autocorrelation at the pitch of a voice above which a piece is voiced: vowels are, a cough or a knock not. */
|
|
11
|
+
const VOICED = 0.5;
|
|
12
|
+
/** The pitch a voice may have, in Hz. */
|
|
13
|
+
const PITCH_LOW = 70;
|
|
14
|
+
const PITCH_HIGH = 400;
|
|
15
|
+
/** The rate voicing is reckoned at: enough for a pitch, little to compute. */
|
|
16
|
+
const VOICING_RATE = 8000;
|
|
17
|
+
/**
|
|
18
|
+
* What the microphone hears, piece by piece (docs/design/ta-voice.md 10): whether a piece is voiced, and the floor of
|
|
19
|
+
* the room, as minimum statistics do: it falls at once to a quieter piece, and rises only to what is not voiced (a fan,
|
|
20
|
+
* the hum of a room), so that the user speaking on and on never becomes the room.
|
|
21
|
+
*/
|
|
22
|
+
export class MicSense {
|
|
23
|
+
constructor() {
|
|
24
|
+
/** The floor of the room: the quietest it was lately, of what is not speech. */
|
|
25
|
+
this.floor = FLOOR;
|
|
26
|
+
}
|
|
27
|
+
measure(samples, rate) {
|
|
28
|
+
const level = PcmUtil.rms(samples);
|
|
29
|
+
const voiced = MicSense.voicing(samples, rate) >= VOICED;
|
|
30
|
+
if (level < this.floor) {
|
|
31
|
+
this.floor = this.floor * 0.6 + level * 0.4;
|
|
32
|
+
}
|
|
33
|
+
else if (!voiced) {
|
|
34
|
+
this.floor = Math.min(level, this.floor * RISE ** ((samples.length / rate) * 10));
|
|
35
|
+
}
|
|
36
|
+
return { level, voiced };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A piece of the microphone while Ta reads and a sound may be the user cutting in (docs/design/ta-voice.md 10):
|
|
40
|
+
* voiced speech louder than `speech` in a run (gaps under GAP_MS) lowers the reading after DUCK_MS ('duck') and cuts
|
|
41
|
+
* in after speechMs ('cut'), unless it is no louder than `echo` (Ta's own voice heard back). What is not voiced (a
|
|
42
|
+
* cough, a knock) only counts as a gap.
|
|
43
|
+
*/
|
|
44
|
+
static weigh(doubt, piece, ms, speech, echo, barge) {
|
|
45
|
+
const loud = piece.level >= speech;
|
|
46
|
+
if (loud && piece.level < echo) {
|
|
47
|
+
doubt.echoed = true;
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
if (!loud || !piece.voiced) {
|
|
51
|
+
doubt.quiet += ms;
|
|
52
|
+
if (doubt.quiet >= GAP_MS) {
|
|
53
|
+
doubt.loud = 0;
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
doubt.quiet = 0;
|
|
58
|
+
doubt.voiced = true;
|
|
59
|
+
doubt.loud += ms;
|
|
60
|
+
if (doubt.loud >= barge.speechMs) {
|
|
61
|
+
return 'cut';
|
|
62
|
+
}
|
|
63
|
+
if (!doubt.ducked && doubt.loud >= Math.min(DUCK_MS, barge.speechMs)) {
|
|
64
|
+
doubt.ducked = true;
|
|
65
|
+
return 'duck';
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* How periodic `samples` are at the pitch of a voice: the highest normalized autocorrelation over the lags of
|
|
71
|
+
* PITCH_LOW to PITCH_HIGH, on samples averaged down to about VOICING_RATE; 0 for silence or noise, near 1 for a vowel.
|
|
72
|
+
*/
|
|
73
|
+
static voicing(samples, rate) {
|
|
74
|
+
const step = Math.max(1, Math.floor(rate / VOICING_RATE));
|
|
75
|
+
const n = Math.floor(samples.length / step);
|
|
76
|
+
if (n < 64) {
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
const x = new Float32Array(n);
|
|
80
|
+
let mean = 0;
|
|
81
|
+
for (let i = 0; i < n; i++) {
|
|
82
|
+
let sum = 0;
|
|
83
|
+
for (let j = 0; j < step; j++) {
|
|
84
|
+
sum += samples[i * step + j];
|
|
85
|
+
}
|
|
86
|
+
x[i] = sum / step;
|
|
87
|
+
mean += x[i];
|
|
88
|
+
}
|
|
89
|
+
mean /= n;
|
|
90
|
+
let energy = 0;
|
|
91
|
+
for (let i = 0; i < n; i++) {
|
|
92
|
+
x[i] -= mean;
|
|
93
|
+
energy += x[i] * x[i];
|
|
94
|
+
}
|
|
95
|
+
if (energy < 1e-8) {
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
const at = rate / step;
|
|
99
|
+
const low = Math.max(1, Math.floor(at / PITCH_HIGH));
|
|
100
|
+
const high = Math.min(n - 32, Math.ceil(at / PITCH_LOW));
|
|
101
|
+
let best = 0;
|
|
102
|
+
for (let lag = low; lag <= high; lag++) {
|
|
103
|
+
let cross = 0;
|
|
104
|
+
let a = 0;
|
|
105
|
+
let b = 0;
|
|
106
|
+
for (let i = 0; i + lag < n; i++) {
|
|
107
|
+
cross += x[i] * x[i + lag];
|
|
108
|
+
a += x[i] * x[i];
|
|
109
|
+
b += x[i + lag] * x[i + lag];
|
|
110
|
+
}
|
|
111
|
+
const r = a && b ? cross / Math.sqrt(a * b) : 0;
|
|
112
|
+
if (r > best) {
|
|
113
|
+
best = r;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return best;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=mic-sense.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What of the microphone a voice service hears (docs/design/ta-voice.md 9): speech, the sound louder than the room for
|
|
3
|
+
* two pieces at least, with the piece before it (its first sound) and HANG pieces after (the gaps between words); the
|
|
4
|
+
* rest goes as silence, so that the service neither answers a noise nor hears a knock or a cough as the user, and still
|
|
5
|
+
* hears them stop. Each piece waits for the next to be known, one piece of delay.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NoiseGate {
|
|
8
|
+
protected readonly hang: number;
|
|
9
|
+
protected pending?: Uint8Array;
|
|
10
|
+
protected wasLoud: boolean;
|
|
11
|
+
protected index: number;
|
|
12
|
+
protected lastVoiced: number;
|
|
13
|
+
constructor(hang?: number);
|
|
14
|
+
/** A piece of PCM16, `loud` when louder than the room: the piece before it as it should go, once known. */
|
|
15
|
+
push(pcm: Uint8Array, loud: boolean): Uint8Array | undefined;
|
|
16
|
+
/** The user is known to speak now (they cut in): what comes goes as it is, a while. */
|
|
17
|
+
open(): void;
|
|
18
|
+
/** What was heard is not to go (the service's own answer played): it begins again. */
|
|
19
|
+
reset(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What of the microphone goes to a voice service (docs/design/ta-voice.md 9): speech alone (NoiseGate), and nothing
|
|
23
|
+
* while what plays is its own answer, which it would hear and answer: that is held, and goes only once the user cuts in.
|
|
24
|
+
*/
|
|
25
|
+
export declare class MicFilter {
|
|
26
|
+
protected held: Uint8Array[];
|
|
27
|
+
protected readonly gate: NoiseGate;
|
|
28
|
+
/** A piece of the microphone: what to send now. `playing`: its own answer plays, or just did. */
|
|
29
|
+
take(pcm: Uint8Array, loud: boolean, playing: boolean): Uint8Array | undefined;
|
|
30
|
+
/** The user cut in: what was held of them, from the start of their words, to send now; then all they say. */
|
|
31
|
+
cutIn(): Uint8Array[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CHUNK_MS, HELD_MS } from './realtime-voice-protocol.js';
|
|
2
|
+
/**
|
|
3
|
+
* What of the microphone a voice service hears (docs/design/ta-voice.md 9): speech, the sound louder than the room for
|
|
4
|
+
* two pieces at least, with the piece before it (its first sound) and HANG pieces after (the gaps between words); the
|
|
5
|
+
* rest goes as silence, so that the service neither answers a noise nor hears a knock or a cough as the user, and still
|
|
6
|
+
* hears them stop. Each piece waits for the next to be known, one piece of delay.
|
|
7
|
+
*/
|
|
8
|
+
export class NoiseGate {
|
|
9
|
+
constructor(hang = 4) {
|
|
10
|
+
this.hang = hang;
|
|
11
|
+
this.wasLoud = false;
|
|
12
|
+
this.index = 0;
|
|
13
|
+
this.lastVoiced = Number.NEGATIVE_INFINITY;
|
|
14
|
+
}
|
|
15
|
+
/** A piece of PCM16, `loud` when louder than the room: the piece before it as it should go, once known. */
|
|
16
|
+
push(pcm, loud) {
|
|
17
|
+
const at = this.index++;
|
|
18
|
+
if (loud && this.wasLoud) {
|
|
19
|
+
this.lastVoiced = at;
|
|
20
|
+
}
|
|
21
|
+
this.wasLoud = loud;
|
|
22
|
+
const pending = this.pending;
|
|
23
|
+
this.pending = pcm;
|
|
24
|
+
if (!pending) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return this.lastVoiced >= at - 1 - this.hang ? pending : new Uint8Array(pending.length);
|
|
28
|
+
}
|
|
29
|
+
/** The user is known to speak now (they cut in): what comes goes as it is, a while. */
|
|
30
|
+
open() {
|
|
31
|
+
this.lastVoiced = this.index;
|
|
32
|
+
}
|
|
33
|
+
/** What was heard is not to go (the service's own answer played): it begins again. */
|
|
34
|
+
reset() {
|
|
35
|
+
this.pending = undefined;
|
|
36
|
+
this.wasLoud = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* What of the microphone goes to a voice service (docs/design/ta-voice.md 9): speech alone (NoiseGate), and nothing
|
|
41
|
+
* while what plays is its own answer, which it would hear and answer: that is held, and goes only once the user cuts in.
|
|
42
|
+
*/
|
|
43
|
+
export class MicFilter {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.held = [];
|
|
46
|
+
this.gate = new NoiseGate();
|
|
47
|
+
}
|
|
48
|
+
/** A piece of the microphone: what to send now. `playing`: its own answer plays, or just did. */
|
|
49
|
+
take(pcm, loud, playing) {
|
|
50
|
+
if (playing) {
|
|
51
|
+
this.held.push(pcm);
|
|
52
|
+
this.held.splice(0, Math.max(0, this.held.length - HELD_MS / CHUNK_MS));
|
|
53
|
+
this.gate.reset();
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
// What was held was the room while it played, not the user.
|
|
57
|
+
this.held.length = 0;
|
|
58
|
+
return this.gate.push(pcm, loud);
|
|
59
|
+
}
|
|
60
|
+
/** The user cut in: what was held of them, from the start of their words, to send now; then all they say. */
|
|
61
|
+
cutIn() {
|
|
62
|
+
this.gate.open();
|
|
63
|
+
return this.held.splice(0);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=noise-gate.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The samples of a microphone, made PCM16 mono at another rate. */
|
|
2
|
+
export declare namespace PcmUtil {
|
|
3
|
+
/** Linear resampling of mono float samples to `to` Hz, as PCM16 little-endian. */
|
|
4
|
+
function toPcm16(samples: Float32Array, from: number, to: number): Uint8Array;
|
|
5
|
+
function toFloat(pcm: Uint8Array): Float32Array;
|
|
6
|
+
function base64(bytes: Uint8Array): string;
|
|
7
|
+
/** How loud samples are (RMS, 0 to 1). */
|
|
8
|
+
function rms(samples: Float32Array): number;
|
|
9
|
+
function bytes(base64: string): Uint8Array;
|
|
10
|
+
}
|