Skip to content

v1.1.0

Latest

Choose a tag to compare

@DjibrilM DjibrilM released this 17 Nov 15:46
6847fd8

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.ts constructs a lightweight companion model directory in os.tmpdir()/echo-voice-cache/cosyvoice3-paralinguistic-v1 containing symlinks to the user's verified weights in ~/.qvac/models/sets/... alongside an augmented vocab.json and merges.txt.
    • This maps 16 Unicode Private Use Area characters (\uE000–\uE00F in COSYVOICE_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.
  • 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.
  • Single-Instruction Conditioning Arbitration (resolveCosyVoiceConditioning):
    • CosyVoice 3 enforces a strict one-instruction-per-synthesis rule (assertSingleCosyvoiceControl), and passing emotion: "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 reference promptSpeechTokens remain preserved (> 0) for true zero-shot prosody.
  • Expanded Expressive Controls:
    • Added the Warm emotion and 8 structured speaking tones (Natural, Warm & Smiling, Conversational, Storyteller, Empathetic, Soft & Hushed, Projecting & Loud, Broadcast) across tts.interface.ts, voice.ts, qvac.ts, and DialogueRoundCard.tsx.

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.
  • Language-Matched Transcripts & Prompt Fallbacks (resolveReferencePromptText, resolveLanguageMatchedReferenceAudio):
    • Resolves sidecar .txt transcripts, REFERENCE_AUDIO_TRANSCRIPTS (fr, es, de, it, pt), REFERENCE_WAV_SIZE_TRANSCRIPTS, and DEFAULT_LANGUAGE_PROMPT_TEXT so zero-shot conditioning always pairs reference audio with an accurate native-language prompt transcript.
  • 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.
  • Catalog Folder & Alias Resolution (src/lib/services/voiceLoader.ts):
    • Added resolveLanguageFolder, alias matching in loadVoicesForLanguage and getCachedVoices, and synchronized language selection via handleSelectLanguage across TextToSpeechScreen.tsx and VoiceLanguageExplorerDialog.tsx.

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 onSelectLanguage call from VoiceListItem.tsx and updated TextToSpeechScreen.tsx so onSelectVoice resolves the chosen voice across state.voices, customVoices, and getCachedVoices() and updates selectedVoiceId, rounds, and language in a single atomic state update.
    • Locked user-selected referenceAudioSrc in voice-engine.service.ts so zero-shot speaker identity is retained through synthesis.
  • 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.

4. UI State Decoupling, Settings Streamlining & History Menu Fixes

  • Local Component State Decoupling (ttsStore.ts, useTextToSpeechState.ts, tts.ts):
    • Migrated transient sidebar UI state (rightPanelTab and historySearch) out of the persisted global Jotai store into local React state in TextToSpeechScreen.tsx, avoiding unnecessary persistence writes and keeping the store focused strictly on generation settings and history data.
  • Streamlined Settings Drawer (SettingsDrawer.tsx):
    • Removed legacy Stability (Temperature), Cloning Fidelity (Top-P), and Emotion 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.
  • History Drawer Layout & Anchored Dropdown Fix (HistoryDrawer.tsx):
    • Dropdown Anchor Fix: The hover toolbar previously toggled hidden (display: none), causing Radix DropdownMenu to lose its trigger bounding box and render at (0, 0) in the top-left corner of the viewport. Switching to opacity-0 pointer-events-none with group-hover:opacity-100, focus-within:opacity-100, and has-[[data-state=open]]:opacity-100 alongside align="end" sideOffset={6} keeps the trigger measurable and anchors the menu cleanly beside the button.
    • Cleaner History Cards & Menu: Removed the CosyVoice 3 badge on history items and removed the Sparkles icon from the Load Full Conversation menu option.

5. Architecture Documentation & Project Showcase

  • Added docs/HOW_IT_WORKS.md and ARTICLE.md documenting 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.md formatting with an embedded product showcase video and added root icon.png.

Platform Installers

  • macOS (Apple Silicon & Intel):
    • Magic-Voice AI-Mac-1.1.0-arm64-Installer.dmg
    • Magic-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