MOSS‑TTS Family is an open‑source speech and sound generation model family from MOSI.AI and the OpenMOSS team. It is designed for high‑fidelity, high‑expressiveness, and complex real‑world scenarios, covering stable long‑form speech, multi‑speaker dialogue, voice/character design, environmental sound effects, and real‑time streaming TTS.
Introduction
When a single piece of audio needs to sound like a real person, pronounce every word accurately, switch speaking styles across content, remain stable over tens of minutes, and support dialogue, role‑play, and real‑time interaction, a single TTS model is often not enough. The MOSS‑TTS Family breaks the workflow into five production‑ready models that can be used independently or composed into a complete pipeline.
MOSS‑TTS: MOSS-TTS is the flagship production TTS foundation model, centered on high-fidelity zero-shot voice cloning with controllable long-form synthesis, pronunciation, and multilingual/code-switched speech. It serves as the core engine for scalable narration, dubbing, and voice-driven products.
MOSS‑TTSD: MOSS-TTSD is a production long-form dialogue model for expressive multi-speaker conversational audio at scale. It supports long-duration continuity, turn-taking control, and zero-shot voice cloning from short references for podcasts, audiobooks, commentary, dubbing, and entertainment dialogue.
MOSS‑VoiceGenerator: MOSS-VoiceGenerator is an open-source voice design model that creates speaker timbres directly from free-form text, without reference audio. It unifies timbre design, style control, and content synthesis, and can be used standalone or as a voice-design layer for downstream TTS.
MOSS‑SoundEffect: MOSS-SoundEffect is a high-fidelity text-to-sound model with broad category coverage and controllable duration for real content production. It generates stable audio from prompts across ambience, urban scenes, creatures, human actions, and music-like clips for film, games, interactive media, and data synthesis.
MOSS‑TTS‑Realtime: MOSS-TTS-Realtime is a context-aware, multi-turn streaming TTS model for real-time voice agents. By conditioning on dialogue history across both text and prior user acoustics, it delivers low-latency synthesis with coherent, consistent voice responses across turns.
MOSS-TTS, MOSS-TTSD and MOSS-TTS-Realtime currently supports 20 languages:
Language
Code
Flag
Language
Code
Flag
Language
Code
Flag
Chinese
zh
🇨🇳
English
en
🇺🇸
German
de
🇩🇪
Spanish
es
🇪🇸
French
fr
🇫🇷
Japanese
ja
🇯🇵
Italian
it
🇮🇹
Hebrew
he
🇮🇱
Korean
ko
🇰🇷
Russian
ru
🇷🇺
Persian (Farsi)
fa
🇮🇷
Arabic
ar
🇸🇦
Polish
pl
🇵🇱
Portuguese
pt
🇵🇹
Czech
cs
🇨🇿
Danish
da
🇩🇰
Swedish
sv
🇸🇪
Hungarian
hu
🇭🇺
Greek
el
🇬🇷
Turkish
tr
🇹🇷
MOSS-TTS
MOSS-TTS is a next-generation, production-grade TTS foundation model focused on voice cloning, ultra-long stable speech generation, token-level duration control, multilingual & code-switched synthesis, and fine-grained Pinyin/phoneme-level pronunciation control. It is built on a clean autoregressive discrete-token recipe that emphasizes high-quality audio tokenization, large-scale diverse pre-training data, and efficient discrete token modeling.
1. Overview
1.1 TTS Family Positioning
MOSS-TTS is the flagship base model in our open-source TTS Family. It is designed as a production-ready synthesis backbone that can serve as the primary high-quality engine for scalable voice applications, and as a strong research baseline for controllable TTS and discrete audio token modeling.
Design goals
Production readiness: robust voice cloning with stable, on-brand speaker identity at scale
Controllability: duration and pronunciation controls that integrate into real workflows
Long-form stability: consistent identity and delivery for extended narration
Multilingual coverage: multilingual and code-switched synthesis as first-class capabilities
1.2 Key Capabilities
MOSS-TTS delivers state-of-the-art quality while providing the fine-grained controllability and long-form stability required for production-grade voice applications, from zero-shot cloning and hour-long narration to token- and phoneme-level control across multilingual and code-switched speech.
State-of-the-art evaluation performance — top-tier objective and subjective results across standard TTS benchmarks and in-house human preference testing, validating both fidelity and naturalness.
Zero-shot Voice Cloning (Voice Clone) — clone a target speaker’s timbre (and part of speaking style) from short reference audio, without speaker-specific fine-tuning.
Ultra-long Speech Generation (up to 1 hour) — support continuous long-form speech generation for up to one hour in a single run, designed for extended narration and long-session content creation.
Token-level Duration Control — control pacing, rhythm, pauses, and speaking rate at token resolution for precise alignment and expressive delivery.
Phoneme-level Pronunciation Control — supports:
pure Pinyin input
pure IPA phoneme input
mixed Chinese / English / Pinyin / IPA input in any combination
Multilingual support — high-quality multilingual synthesis with robust generalization across languages and accents.
Code-switching — natural mixed-language generation within a single utterance (e.g., Chinese–English), with smooth transitions, consistent speaker identity, and pronunciation-aware rendering on both sides of the switch.
1.3 Model Architecture
MOSS-TTS includes two complementary architectures, both trained and released to explore different performance/latency tradeoffs and to support downstream research.
Architecture A: Delay Pattern (MossTTSDelay)
Single Transformer backbone with (n_vq + 1) heads.
Uses delay scheduling for multi-codebook audio tokens.
Strong long-context stability, efficient inference, and production-friendly behavior.
Architecture B: Global Latent + Local Transformer (MossTTSLocal)
Backbone produces a global latent per time step.
A lightweight Local Transformer emits a token block per step.
Streaming-friendly with simpler alignment (no delay scheduling).
Why train both?
Exploration of architectural potential and validation across multiple generation paradigms.
Different tradeoffs: Delay pattern tends to be faster and more stable for long-form synthesis; Local is smaller and excels on objective benchmarks.
Open-source value: two strong baselines for research, ablation, and downstream innovation.
Recommended for production. Faster inference, stronger long-context stability, and robust voice cloning quality. Best for large-scale deployment and long-form narration.
MossTTSLocal-1.7B
Recommended for evaluation and research. Smaller model size with SOTA objective metrics. Great for quick experiments, ablations, and academic studies.
Recommended decoding hyperparameters (per model)
Model
audio_temperature
audio_top_p
audio_top_k
audio_repetition_penalty
MossTTSDelay-8B
1.7
0.8
25
1.0
MossTTSLocal-1.7B
1.0
0.95
50
1.1
2. Quick Start
Environment Setup
We recommend a clean, isolated Python environment with Transformers 5.0.0 to avoid dependency conflicts.
Dependencies are managed in pyproject.toml, which currently pins torch==2.9.1+cu128 and torchaudio==2.9.1+cu128.
If FlashAttention 2 fails to build on your machine, you can skip it and use the default attention backend.
FlashAttention 2 is only available on supported GPUs and is typically used with torch.float16 or torch.bfloat16.
Basic Usage
Tip: For production usage, prioritize MossTTSDelay-8B. The examples below use this model; MossTTSLocal-1.7B supports the same API, and a practical walkthrough is available in moss_tts_local/README.md.
MOSS-TTS provides a convenient generate interface for rapid usage. The examples below cover:
Direct generation (Chinese / English / Pinyin / IPA)
Voice cloning
Duration control
python
1from pathlib import Path
2import importlib.util
3import torch
4import torchaudio
5from transformers import AutoModel, AutoProcessor
6# Disable the broken cuDNN SDPA backend7torch.backends.cuda.enable_cudnn_sdp(False)8# Keep these enabled as fallbacks9torch.backends.cuda.enable_flash_sdp(True)10torch.backends.cuda.enable_mem_efficient_sdp(True)11torch.backends.cuda.enable_math_sdp(True)121314pretrained_model_name_or_path ="OpenMOSS-Team/MOSS-TTS"15device ="cuda"if torch.cuda.is_available()else"cpu"16dtype = torch.bfloat16 if device =="cuda"else torch.float32
1718defresolve_attn_implementation()->str:19# Prefer FlashAttention 2 when package + device conditions are met.20if(21 device =="cuda"22and importlib.util.find_spec("flash_attn")isnotNone23and dtype in{torch.float16, torch.bfloat16}24):25 major, _ = torch.cuda.get_device_capability()26if major >=8:27return"flash_attention_2"2829# CUDA fallback: use PyTorch SDPA kernels.30if device =="cuda":31return"sdpa"3233# CPU fallback.34return"eager"353637attn_implementation = resolve_attn_implementation()38print(f"[INFO] Using attn_implementation={attn_implementation}")3940processor = AutoProcessor.from_pretrained(41 pretrained_model_name_or_path,42 trust_remote_code=True,43)44processor.audio_tokenizer = processor.audio_tokenizer.to(device)4546text_1 ="亲爱的你,\n你好呀。\n\n今天,我想用最认真、最温柔的声音,对你说一些重要的话。\n这些话,像一颗小小的星星,希望能在你的心里慢慢发光。\n\n首先,我想祝你——\n每天都能平平安安、快快乐乐。\n\n希望你早上醒来的时候,\n窗外有光,屋子里很安静,\n你的心是轻轻的,没有着急,也没有害怕。\n\n希望你吃饭的时候胃口很好,\n走路的时候脚步稳稳,\n晚上睡觉的时候,能做一个又一个甜甜的梦。\n\n我希望你能一直保持好奇心。\n对世界充满问题,\n对天空、星星、花草、书本和故事感兴趣。\n当你问“为什么”的时候,\n希望总有人愿意认真地听你说话。\n\n我也希望你学会温柔。\n温柔地对待朋友,\n温柔地对待小动物,\n也温柔地对待自己。\n\n如果有一天你犯了错,\n请不要太快责怪自己,\n因为每一个认真成长的人,\n都会在路上慢慢学会更好的方法。\n\n愿你拥有勇气。\n当你站在陌生的地方时,\n当你第一次举手发言时,\n当你遇到困难、感到害怕的时候,\n希望你能轻轻地告诉自己:\n“我可以试一试。”\n\n就算没有一次成功,也没有关系。\n失败不是坏事,\n它只是告诉你,你正在努力。\n\n我希望你学会分享快乐。\n把开心的事情告诉别人,\n把笑声送给身边的人,\n因为快乐被分享的时候,\n会变得更大、更亮。\n\n如果有一天你感到难过,\n我希望你知道——\n难过并不丢脸,\n哭泣也不是软弱。\n\n愿你能找到一个安全的地方,\n慢慢把心里的话说出来,\n然后再一次抬起头,看见希望。\n\n我还希望你能拥有梦想。\n这个梦想也许很大,\n也许很小,\n也许现在还说不清楚。\n\n没关系。\n梦想会和你一起长大,\n在时间里慢慢变得清楚。\n\n最后,我想送你一个最最重要的祝福:\n\n愿你被世界温柔对待,\n也愿你成为一个温柔的人。\n\n愿你的每一天,\n都值得被记住,\n都值得被珍惜。\n\n亲爱的你,\n请记住,\n你是独一无二的,\n你已经很棒了,\n而你的未来,\n一定会慢慢变得闪闪发光。\n\n祝你健康、勇敢、幸福,\n祝你永远带着笑容向前走。"47text_2 ="We stand on the threshold of the AI era.\nArtificial intelligence is no longer just a concept in laboratories, but is entering every industry, every creative endeavor, and every decision. It has learned to see, hear, speak, and think, and is beginning to become an extension of human capabilities. AI is not about replacing humans, but about amplifying human creativity, making knowledge more equitable, more efficient, and allowing imagination to reach further. A new era, jointly shaped by humans and intelligent systems, has arrived."48text_3 ="nin2 hao3,qing3 wen4 nin2 lai2 zi4 na3 zuo4 cheng2 shi4?"49text_4 ="nin2 hao3,qing4 wen3 nin2 lai2 zi4 na4 zuo3 cheng4 shi3?"50text_5 ="您好,请问您来自哪 zuo4 cheng2 shi4?"51text_6 ="/həloʊ, meɪ aɪ æsk wɪtʃ sɪti juː ɑːr frʌm?/"5253# Use audio from ./assets/audio to avoid downloading from the cloud.54ref_audio_1 ="https://speech-demo.oss-cn-shanghai.aliyuncs.com/moss_tts_demo/tts_readme_demo/reference_zh.wav"55ref_audio_2 ="https://speech-demo.oss-cn-shanghai.aliyuncs.com/moss_tts_demo/tts_readme_demo/reference_en.m4a"5657conversations =[58# Direct TTS (no reference)59[processor.build_user_message(text=text_1)],60[processor.build_user_message(text=text_2)],61# Pinyin or IPA input62[processor.build_user_message(text=text_3)],63[processor.build_user_message(text=text_4)],64[processor.build_user_message(text=text_5)],65[processor.build_user_message(text=text_6)],66# Voice cloning (with reference)67[processor.build_user_message(text=text_1, reference=[ref_audio_1])],68[processor.build_user_message(text=text_2, reference=[ref_audio_2])],69# Duration control70[processor.build_user_message(text=text_2, tokens=325)],71[processor.build_user_message(text=text_2, tokens=600)],72]7374model = AutoModel.from_pretrained(75 pretrained_model_name_or_path,76 trust_remote_code=True,77# If FlashAttention 2 is installed, you can set attn_implementation="flash_attention_2"78 attn_implementation=attn_implementation,79 torch_dtype=dtype,80).to(device)81model.eval()8283batch_size =18485save_dir = Path("inference_root")86save_dir.mkdir(exist_ok=True, parents=True)87sample_idx =088with torch.no_grad():89for start inrange(0,len(conversations), batch_size):90 batch_conversations = conversations[start : start + batch_size]91 batch = processor(batch_conversations, mode="generation")92 input_ids = batch["input_ids"].to(device)93 attention_mask = batch["attention_mask"].to(device)9495 outputs = model.generate(96 input_ids=input_ids,97 attention_mask=attention_mask,98 max_new_tokens=4096,99)100101for message in processor.decode(outputs):102 audio = message.audio_codes_list[0]103 out_path = save_dir /f"sample{sample_idx}.wav"104 sample_idx +=1105 torchaudio.save(out_path, audio.unsqueeze(0), processor.model_config.sampling_rate)106
MOSS-TTS supports continuation-based cloning: provide a prefix audio clip in the assistant message, and make sure the prefix transcript is included in the text. The model continues in the same speaker identity and style.
python
1from pathlib import Path
2import importlib.util
3import torch
4import torchaudio
5from transformers import AutoModel, AutoProcessor
6# Disable the broken cuDNN SDPA backend7torch.backends.cuda.enable_cudnn_sdp(False)8# Keep these enabled as fallbacks9torch.backends.cuda.enable_flash_sdp(True)10torch.backends.cuda.enable_mem_efficient_sdp(True)11torch.backends.cuda.enable_math_sdp(True)121314pretrained_model_name_or_path ="OpenMOSS-Team/MOSS-TTS"15device ="cuda"if torch.cuda.is_available()else"cpu"16dtype = torch.bfloat16 if device =="cuda"else torch.float32
1718defresolve_attn_implementation()->str:19# Prefer FlashAttention 2 when package + device conditions are met.20if(21 device =="cuda"22and importlib.util.find_spec("flash_attn")isnotNone23and dtype in{torch.float16, torch.bfloat16}24):25 major, _ = torch.cuda.get_device_capability()26if major >=8:27return"flash_attention_2"2829# CUDA fallback: use PyTorch SDPA kernels.30if device =="cuda":31return"sdpa"3233# CPU fallback.34return"eager"353637attn_implementation = resolve_attn_implementation()38print(f"[INFO] Using attn_implementation={attn_implementation}")3940processor = AutoProcessor.from_pretrained(41 pretrained_model_name_or_path,42 trust_remote_code=True43)44processor.audio_tokenizer = processor.audio_tokenizer.to(device)4546text_1 ="亲爱的你,\n你好呀。\n\n今天,我想用最认真、最温柔的声音,对你说一些重要的话。\n这些话,像一颗小小的星星,希望能在你的心里慢慢发光。\n\n首先,我想祝你——\n每天都能平平安安、快快乐乐。\n\n希望你早上醒来的时候,\n窗外有光,屋子里很安静,\n你的心是轻轻的,没有着急,也没有害怕。\n\n希望你吃饭的时候胃口很好,\n走路的时候脚步稳稳,\n晚上睡觉的时候,能做一个又一个甜甜的梦。\n\n我希望你能一直保持好奇心。\n对世界充满问题,\n对天空、星星、花草、书本和故事感兴趣。\n当你问“为什么”的时候,\n希望总有人愿意认真地听你说话。\n\n我也希望你学会温柔。\n温柔地对待朋友,\n温柔地对待小动物,\n也温柔地对待自己。\n\n如果有一天你犯了错,\n请不要太快责怪自己,\n因为每一个认真成长的人,\n都会在路上慢慢学会更好的方法。\n\n愿你拥有勇气。\n当你站在陌生的地方时,\n当你第一次举手发言时,\n当你遇到困难、感到害怕的时候,\n希望你能轻轻地告诉自己:\n“我可以试一试。”\n\n就算没有一次成功,也没有关系。\n失败不是坏事,\n它只是告诉你,你正在努力。\n\n我希望你学会分享快乐。\n把开心的事情告诉别人,\n把笑声送给身边的人,\n因为快乐被分享的时候,\n会变得更大、更亮。\n\n如果有一天你感到难过,\n我希望你知道——\n难过并不丢脸,\n哭泣也不是软弱。\n\n愿你能找到一个安全的地方,\n慢慢把心里的话说出来,\n然后再一次抬起头,看见希望。\n\n我还希望你能拥有梦想。\n这个梦想也许很大,\n也许很小,\n也许现在还说不清楚。\n\n没关系。\n梦想会和你一起长大,\n在时间里慢慢变得清楚。\n\n最后,我想送你一个最最重要的祝福:\n\n愿你被世界温柔对待,\n也愿你成为一个温柔的人。\n\n愿你的每一天,\n都值得被记住,\n都值得被珍惜。\n\n亲爱的你,\n请记住,\n你是独一无二的,\n你已经很棒了,\n而你的未来,\n一定会慢慢变得闪闪发光。\n\n祝你健康、勇敢、幸福,\n祝你永远带着笑容向前走。"47text_2 ="We stand on the threshold of the AI era.\nArtificial intelligence is no longer just a concept in laboratories, but is entering every industry, every creative endeavor, and every decision. It has learned to see, hear, speak, and think, and is beginning to become an extension of human capabilities. AI is not about replacing humans, but about amplifying human creativity, making knowledge more equitable, more efficient, and allowing imagination to reach further. A new era, jointly shaped by humans and intelligent systems, has arrived."48ref_text_1 ="太阳系八大行星之一。"49ref_text_2 ="But I really can't complain about not having a normal college experience to you."50# Use audio from ./assets/audio to avoid downloading from the cloud.51ref_audio_1 ="https://speech-demo.oss-cn-shanghai.aliyuncs.com/moss_tts_demo/tts_readme_demo/reference_zh.wav"52ref_audio_2 ="https://speech-demo.oss-cn-shanghai.aliyuncs.com/moss_tts_demo/tts_readme_demo/reference_en.m4a"5354conversations =[55# Continuatoin only56[57 processor.build_user_message(text=ref_text_1 + text_1),58 processor.build_assistant_message(audio_codes_list=[ref_audio_1])59],60# Continuation with voice cloning61[62 processor.build_user_message(text=ref_text_2 + text_2, reference=[ref_audio_2]),63 processor.build_assistant_message(audio_codes_list=[ref_audio_2])64],65]6667model = AutoModel.from_pretrained(68 pretrained_model_name_or_path,69 trust_remote_code=True,70# If FlashAttention 2 is installed, you can set attn_implementation="flash_attention_2"71 attn_implementation=attn_implementation,72 torch_dtype=dtype,73).to(device)74model.eval()7576batch_size =17778save_dir = Path("inference_root")79save_dir.mkdir(exist_ok=True, parents=True)80sample_idx =081with torch.no_grad():82for start inrange(0,len(conversations), batch_size):83 batch_conversations = conversations[start : start + batch_size]84 batch = processor(batch_conversations, mode="continuation")85 input_ids = batch["input_ids"].to(device)86 attention_mask = batch["attention_mask"].to(device)8788 outputs = model.generate(89 input_ids=input_ids,90 attention_mask=attention_mask,91 max_new_tokens=4096,92)9394for message in processor.decode(outputs):95 audio = message.audio_codes_list[0]96 out_path = save_dir /f"sample{sample_idx}.wav"97 sample_idx +=198 torchaudio.save(out_path, audio.unsqueeze(0), processor.model_config.sampling_rate)99
Input Types
UserMessage
Field
Type
Required
Description
text
str
Yes
Text to synthesize. Supports Chinese, English, German, French, Spanish, Japanese, Korean, etc. Can mix raw text with Pinyin or IPA for pronunciation control.
reference
List[str]
No
Reference audio for voice cloning. For current MOSS-TTS, one audio is expected in the list.
tokens
int
No
Expected number of audio tokens. 1s ≈ 12.5 tokens.
AssistantMessage
Field
Type
Required
Description
audio_codes_list
List[str]
Only for continuation
Prefix audio for continuation-based cloning. Use audio file paths or URLs.
Generation Hyperparameters
Parameter
Type
Default
Description
max_new_tokens
int
—
Controls total generated audio tokens. Use duration rule: 1s ≈ 12.5 tokens.
audio_temperature
float
1.7
Higher values increase variation; lower values stabilize prosody.
audio_top_p
float
0.8
Nucleus sampling cutoff. Lower values are more conservative.
Note: MOSS-TTS is a pretrained base model and is sensitive to decoding hyperparameters. See Released Models for recommended defaults.
Pinyin Input
Use tone-numbered Pinyin such as ni3 hao3 wo3 men1. You can convert Chinese text with pypinyin, then adjust tones for pronunciation control.
python
1import re
2from pypinyin import pinyin, Style
34CN_PUNCT =r",。!?;:、()“”‘’"567deffix_punctuation_spacing(s:str)->str:8 s = re.sub(rf"\s+([{CN_PUNCT}])",r"\1", s)9 s = re.sub(rf"([{CN_PUNCT}])\s+",r"\1", s)10return s
111213defzh_to_pinyin_tone3(text:str, strict:bool=True)->str:14 result = pinyin(15 text,16 style=Style.TONE3,17 heteronym=False,18 strict=strict,19 errors="default",20)2122 s =" ".join(item[0]for item in result)23return fix_punctuation_spacing(s)2425text = zh_to_pinyin_tone3("您好,请问您来自哪座城市?")26print(text)2728# Expected: nin2 hao3,qing3 wen4 nin2 lai2 zi4 na3 zuo4 cheng2 shi4?29# Try: nin2 hao3,qing4 wen3 nin2 lai2 zi4 na4 zuo3 cheng4 shi3?
IPA Input
Use /.../ to wrap IPA sequences so they are distinct from normal text. You can use DeepPhonemizer to convert English paragraphs or words into IPA sequences.
python
1from dp.phonemizer import Phonemizer
23# Download a phonemizer checkpoint from https://public-asai-dl-models.s3.eu-central-1.amazonaws.com/DeepPhonemizer/en_us_cmudict_ipa_forward.pt4model_path ="<path-to-phonemizer-checkpoint>"5phonemizer = Phonemizer.from_checkpoint(model_path)67english_texts ="Hello, may I ask which city you are from?"8phoneme_outputs = phonemizer(9 english_texts,10 lang="en_us",11 batch_size=812)13model_input_text =f"/{phoneme_outputs}/"14print(model_input_text)1516# Expected: /həloʊ, meɪ aɪ æsk wɪtʃ sɪti juː ɑːr frʌm?/
3. Evaluation
MOSS-TTS achieved state-of-the-art results on the open-source zero-shot TTS benchmark Seed-TTS-eval, not only surpassing all open-source models but also rivaling the most powerful closed-source models.