makepad/widgets/Cargo.toml
Admin 97e9572f42 speech: one STT/TTS API on every platform, through the ai-hub
Apps ask the hub for a recognizer or a voice and get one; where it runs is
the hub's decision. AiHub::start_stt / start_tts return poll-driven
sessions shaped like the chat session. The Auto ladder is Whisper/Kokoro in
this process (weights present, machine election), on the machine node over
loopback, on a LAN node, else the OS engine; SpeechReach::Local is the
"don't reach out" knob. Audio always comes back as PCM: the app owns the
device.

Three layers:
- makepad-ai-speech is the whole speech model family, engines only.
  libs/voice (Whisper + Silero VAD) folds in as the `whisper` and `vad`
  modules next to kokoro and indextts, each a cargo feature; the Apple
  bridges and the Speaker/VoiceTranscriber selection leave it.
- makepad-system-speech (new) is the OS speech services as blocking fns:
  Apple SpeechAnalyzer/AVSpeechSynthesizer via Swift, Windows.Media.Speech*
  on the vendored bindings, Android SpeechRecognizer/TextToSpeech through
  MakepadSpeech.java (API 26 floor), espeak-ng on Linux. It models the two
  STT shapes honestly: PCM in (Whisper, Apple) versus an engine that owns
  the microphone (Android, Windows), with capabilities the caller reads.
- the hub grows speech sessions, in-process Whisper/Kokoro workers with the
  residency election, a `whisper` wire backend (stt domain, registry entry
  pinned to ggerganov/whisper.cpp) so a Mac can serve a Quest, and a
  `language` field on the generate request.

Consumers: the Window voice input runs on an STT session and switches to
engine-mic mode when the recognizer owns the microphone; converse's
SpeechOutput is a lazily started TTS session plus a pump thread; route
drops its private speech copy for converse; vj's lyrics fallback and the
alignment bakes call the engines directly.

Verified here: speech-roundtrip through the real sessions (Apple voice in,
in-process Whisper on Metal out, 4.3% WER); system-speech-test TTS->STT
verbatim; hub/converse/system-speech unit tests; msvc, aarch64-android and
linux-gnu cross-checks; Java against android-34. Windows, Android and Linux
bridges are compile-checked only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-01 23:32:35 +02:00

44 lines
2.1 KiB
TOML

[package]
name = "makepad-widgets"
version = "2.0.0"
authors = ["Makepad <info@makepad.nl>"]
edition = "2021"
description = "Makepad widgets2"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/makepad/makepad/"
repository = "https://github.com/makepad/makepad/"
metadata.makepad-auto-version = "N0YGjn7dnhc4DEHmww9lwuYwMVI="
[dependencies]
makepad-draw = { path = "../draw", version = "2.0.0" }
makepad-derive-widget = {path = "./derive_widget", version="2.0.0"}
makepad-mbtile-reader = { path = "../libs/mbtile_reader", version = "1.0.0", optional = true }
i_overlay = { path = "../libs/i_overlay", version = "7.0.3", optional = true, default-features = false }
makepad-fast-inflate = { path = "../libs/fast_inflate", optional = true }
# Silero VAD (the speech gate) from the speech model family; only that module.
makepad-ai-speech = { path = "../libs/ai/models/speech", default-features = false, features = ["vad"], optional = true }
# Speech-to-text sessions (Whisper here / machine / LAN, else the OS engine).
# No default features: only the speech pipes, never the image/video backends.
makepad-ai-hub = { path = "../libs/ai/hub", default-features = false, features = ["stt"], optional = true }
makepad-cef = { path = "../libs/cef", optional = true }
makepad-html = { path = "../libs/html", version = "1.0.0" }
unicode-segmentation = { version = "1.12.0", path = "../libs/unicode/unicode-segmentation" }
pulldown-cmark = { version = "0.12.2", path = "../libs/pulldown-cmark", default-features = false, features = ["simd"] }
makepad-latex-math = { path = "../libs/latex_math", version = "0.1.0" }
makepad-pdf-parse = { path = "../libs/pdf_parse", version = "1.0.0", optional = true }
ttf-parser = { path = "../libs/ttf-parser" }
serde = { version = "1.0", optional = true, features = ["derive"] }
[features]
default = []
voice = ["dep:makepad-ai-speech", "dep:makepad-ai-hub"]
maps = ["dep:makepad-mbtile-reader", "dep:makepad-fast-inflate", "dep:i_overlay"]
pdf = ["dep:makepad-pdf-parse"]
cef = ["dep:makepad-cef"]
## Enables certain public-facing types to derive serde serialization traits.
serde = ["dep:serde", "makepad-draw/serde", "makepad-derive-widget/serde"]