Update docs

This commit is contained in:
2026-06-17 00:52:02 +02:00
parent 63b241cc2e
commit 2f643e4293
6 changed files with 160 additions and 31 deletions

View File

@@ -10,7 +10,7 @@ stable **C ABI** (`voicecat.h`).
┌───────────────────────────────────────────┐
macOS / iOS (Swift) │ │ Windows (C#)
┌──────────────────┐ │ libvoicecat (C++) │ ┌──────────────────┐
│ SwiftUI views │ │ ┌─────────────────────────────────────┐ │ │ WinUI/Avalonia
│ SwiftUI views │ │ ┌─────────────────────────────────────┐ │ │ WinForms (.NET 10
│ AVAudioSession │──┼─▶│ C ABI (voicecat.h) │◀─┼──│ LibraryImport │
│ Swift↔C++ interop│ │ ├─────────────────────────────────────┤ │ │ P/Invoke │
└──────────────────┘ │ │ Session / Protocol state machine │ │ └──────────────────┘
@@ -150,10 +150,14 @@ Design notes:
frames, so audio-only stays well within budget. It links a *minimal* slice of the core
(Opus encode + media send), shares the session/credentials with the host app through an
**App Group**, and re-derives its own media keys. This is detailed in [voice.md](voice.md) §9.
- **C# / Windows.** `LibraryImport` (source-generated P/Invoke, .NET 7+) over the C ABI.
Marshal the `on_event` callback as a `[UnmanagedCallersOnly]`/function-pointer to avoid
delegate lifetime pitfalls. UI in **WinUI 3** (most native) or **Avalonia** (if we later
want a single C# UI across desktop OSes).
- **C# / Windows.** `[LibraryImport]` (source-generated P/Invoke, .NET 7+) over the C ABI.
`[UnmanagedCallersOnly]` static methods for `on_event`/`on_level` to avoid delegate-lifetime
pitfalls. UI in **WinForms (.NET 10)** — chosen over WinUI 3/Avalonia for its mature,
predictable screen-reader (NVDA/JAWS/Narrator) UIA support (see roadmap.md §2).
Events are delivered via `System.Threading.Channels.Channel<VoiceCatEvent>`, drained by a
30ms `System.Windows.Forms.Timer` on the UI thread — simpler than a message-only HWND +
`PostMessage` with no meaningful latency cost. `VoiceCatClientHandle : SafeHandle` wraps
the `vc_client*` and guarantees `vc_client_destroy` runs on GC/Dispose.
## 5. Server architecture