Repository navigation
Magic-Voice AI v1.1.0 — Multilingual Conditioning, Paralinguistic Architecture & Engine Refinements
Magic-Voice AI v1.1.0 builds on v1.0.0 with major architectural improvements to the CosyVoice 3 conditioning pipeline, native paralinguistic token execution, end-to-end multilingual synthesis, speaker identity preservation, and UI state management.
New Implementations & Architecture Changes (vs. v1.0.0)
1. Native Paralinguistic Token Architecture & Prompt Conditioning
How It Works & Why It Was Built
CosyVoice 3's pretrained 0.5B LLM already contains 16 trained paralinguistic token IDs (151647–151662) for natural respiration, laughter, emphasis, sighs, and vocal textures, but standard text tokenizers interpret bracketed tags (like [laughter] or [breath]) as plain English words. Modifying the downloaded GGUF/tokenizer assets in place would break QVAC's registry SHA-256 and byte-size integrity checks.
- Non-Destructive Companion Model Directory (
ensureParalinguisticCompanionModelPath):- At runtime,
electron/core/tts/services/voice-engine.service.tsconstructs a lightweight companion model directory inos.tmpdir()/echo-voice-cache/cosyvoice3-paralinguistic-v1containing symlinks to the user's verified weights in~/.qvac/models/sets/...alongside an augmentedvocab.jsonandmerges.txt. - This maps 16 Unicode Private Use Area characters (
\uE000–\uE00FinCOSYVOICE_PARALINGUISTIC_TOKENS) directly to CosyVoice 3's trained token IDs (151647–151662), unlocking native[breath],<strong>/</strong>,[noise],[laughter],<laughter>/</laughter>,[cough],[clucking],[accent],[quick_breath],[hissing],[sigh],[vocalized-noise],[lipsmack], and[mn]while keeping the original model cache untouched.
- At runtime,
- Expressive Cue Translation (
processConversationalCues&ensureNaturalSentencePunctuation):- Converts user-facing script tags (
[smile],[laugh],[chuckle],[hmm],[sigh],[breath],[gasp],[whisper],[yell]/[loud],[raise]/[emphasis]) into their corresponding paralinguistic token sequences or segment tone directives so tags shape vocal delivery without ever being read aloud, while normalizing trailing punctuation for natural cadence boundaries.
- Converts user-facing script tags (
- Single-Instruction Conditioning Arbitration (
resolveCosyVoiceConditioning):- CosyVoice 3 enforces a strict one-instruction-per-synthesis rule (
assertSingleCosyvoiceControl), and passingemotion: "neutral"triggers the flat instruct path that drops reference voice speech tokens (promptSpeechTokens = 0). resolveCosyVoiceConditioning()unifies segment-level volume tags,speakingTone,emotion,pace,dialect(VALID_COSYVOICE_DIALECTS),customPrompt(normalizeCustomVoicePrompt), and target language into a single non-conflicting directive—omitting flat defaults when unconditioned so referencepromptSpeechTokensremain preserved (> 0) for true zero-shot prosody.
- CosyVoice 3 enforces a strict one-instruction-per-synthesis rule (
- Expanded Expressive Controls:
- Added the
Warmemotion and 8 structured speaking tones (Natural,Warm & Smiling,Conversational,Storyteller,Empathetic,Soft & Hushed,Projecting & Loud,Broadcast) acrosstts.interface.ts,voice.ts,qvac.ts, andDialogueRoundCard.tsx.
- Added the
2. End-to-End Multilingual Language Switching & Conditioning
Why Previous Language Switching Failed
Previously, switching the target language in the studio UI updated renderer state without consistently propagating language instructions, native reference transcripts, or localized catalog resolutions into the CosyVoice 3 inference worker—causing non-English prompts (such as French) to default back to English pronunciation.
- Target Language Normalization & Instruct Injection (
TARGET_LANGUAGE_MAP,normalizeTargetLanguage,applyLanguageToInstruct):- Maps language codes, English names, and native labels across English regional accents (
en,en-gb,en-in,en-au,en-af), French (fr), Spanish (es), German (de), Italian (it), Portuguese (pt), Japanese (ja), Chinese (zh), Korean (ko), Hindi (hi), Arabic (ar), Russian (ru), and Swahili (sw). - Injects the Chinese instruct prefix expected by CosyVoice 3 (e.g.,
请用法语,...) whenever a non-English target language is active.
- Maps language codes, English names, and native labels across English regional accents (
- Language-Matched Transcripts & Prompt Fallbacks (
resolveReferencePromptText,resolveLanguageMatchedReferenceAudio):- Resolves sidecar
.txttranscripts,REFERENCE_AUDIO_TRANSCRIPTS(fr,es,de,it,pt),REFERENCE_WAV_SIZE_TRANSCRIPTS, andDEFAULT_LANGUAGE_PROMPT_TEXTso zero-shot conditioning always pairs reference audio with an accurate native-language prompt transcript.
- Resolves sidecar
- Conversational Shorthand Normalization (
preprocessLanguageShorthand):- Expands informal abbreviations for the active target language (e.g., French chat shorthand like
cv->ça va ?,bjr->bonjour,slt->salut,stp->s'il te plaît) prior to tokenization so the model speaks natural words instead of spelling out individual letters.
- Expands informal abbreviations for the active target language (e.g., French chat shorthand like
- Catalog Folder & Alias Resolution (
src/lib/services/voiceLoader.ts):- Added
resolveLanguageFolder, alias matching inloadVoicesForLanguageandgetCachedVoices, and synchronized language selection viahandleSelectLanguageacrossTextToSpeechScreen.tsxandVoiceLanguageExplorerDialog.tsx.
- Added
3. Selected Speaker Preservation & Persistence Reliability
Root Cause & Fix
Selecting a speaker in the Voice Explorer previously fired both onSelectVoice and onSelectLanguage sequentially; the asynchronous loadVoicesForLanguage promise could resolve afterward and overwrite selectedVoiceId and rounds[i].voiceId with the language's default voice, or allow missing reference paths to fall back to the model's baked female voice.gguf speaker.
- Atomic Voice & Language Selection:
- Removed the redundant
onSelectLanguagecall fromVoiceListItem.tsxand updatedTextToSpeechScreen.tsxsoonSelectVoiceresolves the chosen voice acrossstate.voices,customVoices, andgetCachedVoices()and updatesselectedVoiceId,rounds, andlanguagein a single atomic state update. - Locked user-selected
referenceAudioSrcinvoice-engine.service.tsso zero-shot speaker identity is retained through synthesis.
- Removed the redundant
- Deterministic Dialogue Round Primary Keys:
- Updated
ConversationRepositoryService(electron/core/tts/services/conversation-repository.service.ts) to generate deterministic${data.id}-round-${idx}round IDs instead of reusing incoming IDs, preventing SQLite primary-key collisions when saving edited conversations.
- Updated
4. UI State Decoupling, Settings Streamlining & History Menu Fixes
- Local Component State Decoupling (
ttsStore.ts,useTextToSpeechState.ts,tts.ts):- Migrated transient sidebar UI state (
rightPanelTabandhistorySearch) out of the persisted global Jotai store into local React state inTextToSpeechScreen.tsx, avoiding unnecessary persistence writes and keeping the store focused strictly on generation settings and history data.
- Migrated transient sidebar UI state (
- Streamlined Settings Drawer (
SettingsDrawer.tsx):- Removed legacy
Stability (Temperature),Cloning Fidelity (Top-P), andEmotion Intensity (CFG Scale)sliders that no longer mapped cleanly onto CosyVoice 3's instruction-conditioned pipeline, simplifying the drawer around prompt presets, audio clarity, and target language controls.
- Removed legacy
- History Drawer Layout & Anchored Dropdown Fix (
HistoryDrawer.tsx):- Dropdown Anchor Fix: The hover toolbar previously toggled
hidden(display: none), causing RadixDropdownMenuto lose its trigger bounding box and render at(0, 0)in the top-left corner of the viewport. Switching toopacity-0 pointer-events-nonewithgroup-hover:opacity-100,focus-within:opacity-100, andhas-[[data-state=open]]:opacity-100alongsidealign="end" sideOffset={6}keeps the trigger measurable and anchors the menu cleanly beside the button. - Cleaner History Cards & Menu: Removed the
CosyVoice 3badge on history items and removed theSparklesicon from the Load Full Conversation menu option.
- Dropdown Anchor Fix: The hover toolbar previously toggled
5. Architecture Documentation & Project Showcase
- Added
docs/HOW_IT_WORKS.mdandARTICLE.mddocumenting the two-tier Electron topology, typed IPC bridge, 6-stage CosyVoice 3 synthesis pipeline, paralinguistic token translation, CAM++/S3Tok zero-shot cloning, Lava-SR 48kHz upsampling, and state architecture. - Updated
README.mdformatting with an embedded product showcase video and added rooticon.png.
Platform Installers
- macOS (Apple Silicon & Intel):
Magic-Voice AI-Mac-1.1.0-arm64-Installer.dmgMagic-Voice AI-Mac-1.1.0-x64-Installer.dmg
- Windows (64-bit NSIS Setup):
Magic-Voice AI-Windows-1.1.0-x64-Setup.exe
What's Changed
- feat: consolidate TTS engine to CosyVoice 3, redesign iOS-style Settngs, fix mic permissions, and add app icons by @DjibrilM in #1
- fix(models,macos): enforce concurrent model download verification gate and set native macOS Dock icon by @DjibrilM in #2
- build(release): configure multi-platform installers and unpack Prisma runtime for packaged apps by @DjibrilM in #3
- fix(voices): bundle and resolve voice assets in packaged builds by @DjibrilM in #4
- fix(runtime): resolve Bare worker spawn ENOTDIR in packaged builds by @DjibrilM in #5
- feat: improve CosyVoice 3 prompt engineering, local sidebar state, and technical docs by @DjibrilM in #7
- Fx packaged voices loading by @DjibrilM in #8
Full Changelog: https://github.com/DjibrilM/MagicVoiceAI/commits/1.1.0