Repository navigation
PDChat: Voice Mode, so a user can ask out loud and hear the answer - #228
Merged
Merged
Conversation
A host offers it by implementing IChatService.VoiceEndpoints, a new default interface member that returns null, so existing services compile unchanged and show nothing. - A "Voice" switch in the header, off by default, whose title says what it does; a status line says what is happening. - Microphone capture resampled to 24 kHz in an AudioWorklet, sent to the host's listen endpoint. The host decides when the question has ended. - A spoken question is sent through the same path as a typed one, so the question and the written answer are both in the transcript. - Only the first finished reply to a spoken question is read aloud (never a Typing placeholder, never a later notification), through the host's speak endpoint, with playback starting as the first audio arrives. - Half duplex: the microphone sends nothing while the answer is awaited or spoken, so the assistant never hears itself. - Refused microphones and closed connections are explained, not silent. For Magic Suite MS-26473; the host side is panoramicdata/MagicSuite#451. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 82 |
| Duplication | 5 |
🟢 Coverage 48.39% diff coverage · -0.10% coverage variation
Metric Results Coverage variation ✅ -0.10% coverage variation Diff coverage ✅ 48.39% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (470f58c) 15712 15712 100.00% Head commit (d14aa9b) 15743 (+31) 15727 (+15) 99.90% (-0.10%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#228) 31 15 48.39% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
ESLint's compat rule checks against browserslist defaults, which include Opera Mini. It cannot run Blazor (no WebSockets), so its URL and Promise findings on pdchat-voice.js are not real gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 046a4bc.
Codacy's ESLint ignores the repository's browserslist, so the Opera Mini findings are fixed in code instead: - speak() calls back OnVoiceSpoken rather than returning a Promise; the wait is on the C# side. - The websocket URL is built from location with string operations. - The capture worklet is its own static file rather than a Blob URL, which also means a Content Security Policy need not allow blob: scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…his.sampleRate Codacy: no literal ws:// (an https page always gets wss), and sampleRate read as the AudioWorkletGlobalScope property it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Voice Mode to
PDChat: a user can ask a question out loud, pause, and hear the answer. This is for Magic Suite MS-26473. The host side, which relays to self-hosted Kyutai speech services, is panoramicdata/MagicSuite#451.Public API, additive only
IChatService.VoiceEndpointsis a default interface member returningnull, so every existing implementation compiles unchanged and shows no Voice Mode control.PDChatVoiceEndpoints(string ListenUrl, string SpeakUrl)is a new record documenting the websocket protocol the host must speak.PDChatVoiceStateis a new enum, andPDChat.VoiceState/PDChat.VoiceErrorare new read-only properties.[Parameter]is added or changed, soComponentDocumentation.mdis unaffected.Behaviour
aria-pressed, and a status line gives the state: Listening, Thinking, Speaking, or an explanation.getUserMedia, resampled to 24 kHz in an AudioWorklet. A fixed-rate AudioContext cannot be connected to a microphone in every browser. Audio goes out in 80 ms frames to the host's listen endpoint, and the host decides when the question has ended.Typingreply to a spoken question. Later notifications are never spoken, and nothing is spoken with Voice Mode off. HTML markup is stripped first; the host does the rest.wwwroot/js/pdchat-voice.js) is imported only when Voice Mode is first switched on.Verification
PDChatTests.Voice.cs) cover:PanoramicData.Blazor.slnxbuilds with 0 errors. The 2 warnings are the SDK's pre-existing "packaging disabled" notices for non-packable projects.pdchat-voice.jsis Prettier-clean and passesnode --check.DumbChatServicehas no speech endpoints to offer, so Voice Mode never appears there. Browser behaviour gets its real check once Magic Suite consumes the package.🤖 Generated with Claude Code