Add Qwen (Alibaba) qwen-audio-3.0-tts as a fourth TTS backend#167
Merged
Conversation
Adds "qwen" alongside elevenlabs, mistral, and xai, following the xAI backend pattern end to end. Backend: - New artificial_u/integrations/qwen/ package: QwenTTSClient (wraps the dashscope SDK SpeechSynthesizer, WebSocket-only, requests MP3 so the existing chunk-concat + ffmpeg remux pipeline is unchanged) and a static QwenVoiceManager preset catalog (Alibaba exposes no voice-list API). - QwenTTSBackend adapter, registered in the TTS factory. - ALIBABA_API_KEY / TTS_QWEN_MODEL / ALIBABA_TTS_WSS_URL settings + defaults, wired through system.py; explicit qwen branch in the speech processor. API + frontend: - GET /api/v1/voices/qwen/catalog; qwen enrichment branch in VoiceService (extracted per-provider enrichment into a helper to stay under the flake8 complexity limit). Preview/assign already work generically. - New "Qwen (Alibaba)" tab in ProfessorVoice.tsx with a QwenVoiceCard, plus types/config/service and i18n keys in en/es/fr/zh. Tests/CI/docs: - New tests/unit/integrations/test_qwen_tts.py (13 tests), api-key assertions, both CI workflows, speech-processor test, seed script, and configuration.md. Region note: qwen-audio-3.0-tts is hosted only in the Singapore and Beijing regions (verified: us-east-1 404s the websocket route). Keys are region-locked, so the default endpoint is Singapore (dashscope-intl); a Singapore-region ALIBABA_API_KEY is required to generate audio. Voice cloning / Voice Design are deferred pending 3.0-family international API docs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Refreshed from the Alibaba Qwen-Audio-TTS voice list (verified live against the API with a Singapore-region key): - Fixed Longan Lufeng gender to Male. - Added 11 Mandarin-only base (cloned) voices, which use the model-prefixed voice parameter (e.g. qwen-audio-3.0-tts-plus-longyinghaikai); useful for Chinese-language content. Long Ying Hai Kai set to Female per the source. - Omitted child voices (age < 18): Longjie Lidou, Long Paopao, Long Huohuo. - Kept the existing English/bilingual system voices (all confirmed working). Updated unit tests for the new catalog shape (base voices, child exclusion). Co-Authored-By: Claude Fable 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.
What & why
Adds a fourth TTS backend,
qwen(Alibaba Model Studio's newly released qwen-audio-3.0-tts), alongside ElevenLabs, Mistral (Voxtral), and xAI (Grok). It follows the xAI backend pattern end to end so professors can be assigned a Qwen preset voice from the voice-selection UI.Changes
Backend
artificial_u/integrations/qwen/package:QwenTTSClient— wraps the officialdashscopeSDKSpeechSynthesizer(the 3.0 models are WebSocket-only). Requests MP3 output soTTSService's existing chunk-concat + ffmpeg remux pipeline works unchanged. Retry/backoff mirrors the xAI client. Resolves flash vs. plus model from the chosen voice.QwenVoiceManager— static 14-voice preset catalog (Alibaba exposes no voice-list API for these models).QwenTTSBackendadapter, registered inintegrations/tts/factory.py.ALIBABA_API_KEY,TTS_QWEN_MODEL,ALIBABA_TTS_WSS_URLin settings/defaults, wired throughsystem.py. Explicitqwenbranch in the speech processor.API + frontend
GET /api/v1/voices/qwen/catalog(static list, filterable by language/gender).qwenenrichment branch inVoiceService.manual_voice_assignment_generic— extracted per-provider enrichment into a_enrich_generic_voicehelper to stay under the flake8 complexity limit. Preview and assign already work generically.ProfessorVoice.tsxwith aQwenVoiceCard(name, description, gender, flash/plus tier badge), plustypes.ts/config.ts/voice-service.tsand i18n keys in en/es/fr/zh.Tests / CI / docs
tests/unit/integrations/test_qwen_tts.py(13 tests), api-key assertions intest_api_keys.py+conftest.py,ALIBABA_API_KEYadded to both CI workflows, speech-processor test,scripts/seed_qwen_voices.py, anddocs/configuration.md.Verification
black/isort/flake8and frontendeslint/biome/stylelint/buildall clean.qwen-audio-3.0-tts is hosted only in the Singapore and Beijing regions, not us-east-1 (Virginia). Verified by probing with a real key:
dashscope-us)dashscope-intl)dashscope)Alibaba API keys are region-locked, so a Singapore- (or Beijing-) region
ALIBABA_API_KEYis required to generate audio. The defaultALIBABA_TTS_WSS_URLis set to Singapore (dashscope-intl) accordingly — a us-east-1 default provably cannot serve this model.Deferred
qwen-voice-enrollmentcloning API currently targets only theqwen3-tts-vcfamily, not 3.0, and Voice Design has no international API docs yet. A clone-to-qwen flow can later mirror the existing clone-to-mistral feature.🤖 Generated with Claude Code