近日,我们通过 Qwen API 更新了 Qwen-TTS ( qwen-tts-latest or qwen-tts-2025-05-22 ) 的最新版本。此次,Qwen-TTS 新增支持生成三种中文方言,包括北京话、上海话和四川话。
Qwen-TTS 使用了超过 300 万小时的大规模语料库进行训练,合成效果达到了人类级别的自然度和表现力。值得一提的是,Qwen-TTS 能够根据输入文本自动调整韵律、节奏和情绪变化,进一步提升语音的真实感和表达力。
目前,Qwen-TTS 支持七种中英双语音色,包括 Cherry、Ethan、Chelsie、Serena、Dylan(北京话)、Jada(上海话) 和 Sunny(四川话)。未来,我们还将推出更多语言和语音风格,进一步丰富用户的选择体验。
Qwen-TTS API 地址
中文方言样例
这里有一些样例展示了 Qwen-TTS 在中文方言上的自然生成能力。
音色:Dylan
方言种类:北京话
文本1:我们家那边后面有一个后山,就护城河那边,完了呢我们就在山上啊就其实也没什么,就是在土坡上跑来跑去,然后谁捡个那个嗯比较威风的棍,完了我们就呃得瞎打呃,要不就是什么掏个洞啊什么的。
文本2:得有自己的想法,别净跟着别人瞎起哄,多动动脑子,有点儿结构化的思维啥的。
音色:Jada
方言种类:上海话
文本1:侬只小赤佬,啊呀,数学句子错它八道题,还想吃肯德基啊!夜到麻将队三缺一啊,嘿嘿,叫阿三头来顶嘛!哦,提前上料这样产品,还要卖 300 块硬币啊。
文本2:侬来帮伊向暖吧,天光已经暗转亮哉。
音色:Sunny
方言种类:四川话
文本1:胖娃胖嘟嘟,骑马上成都,成都又好耍。胖娃骑白马,白马跳得高。胖娃耍关刀,关刀耍得圆。胖娃吃汤圆。
文本2:他一辈子的使命就是不停地爬哟,爬到大海头上去,不管有好多远!
其他成果
Qwen-TTS 生成的效果目前已经达到了人类水平,其在 SeedTTS-Eval 评测集上的指标如下:
以下是这四种音色对应的一些中英双语样例:
音色:Cherry
文本1:对吧!我就特别喜欢这种超市,尤其是过年的时候,去逛超市就觉得超级超级开心,然后买点儿东西就要买好多好多东西,这个也想买那个也想买,然后买一堆东西带回去。
文本2:Take a look at
音色:Ethan
文本1:啊?真的假的?他们俩拍吻戏。可是我觉得他们两个没有 CP 感欸。
文本2:Jane's eyes wide with terror, she screamed, "The brakes aren't working! What do we do now? We're completely trapped, and we're heading straight for that wall, I can't stop it!" Then, a strange calm washed over her as she murmured, "Well, at least the view was nice. It's almost poetic, this beautiful scene for our grand finale, isn't it?"
更多语音合成样例欢迎前往Qwen API。
使用方法
通过 Qwen API 使用 Qwen-TTS 是较为简单的,下方是一个简单的代码片段以供体验:
import os import requests import dashscope def get_api_key(): api_key = os.getenv("DASHSCOPE_API_KEY") ifnot api_key: raise EnvironmentError("DASHSCOPE_API_KEY environment variable not set.") return api_key def synthesize_speech(text, voice="Dylan", model="qwen-tts-latest"): api_key = get_api_key() try: response = dashscope.audio.qwen_tts.SpeechSynthesizer.call( model=model, api_key=api_key, text=text, voice=voice, ) # Check if response is None if response is None: raise RuntimeError("API call returned None response") # Check if response.output is None if response.output is None: raise RuntimeError("API call failed: response.output is None") # Check if response.output.audio exists ifnot hasattr(response.output, 'audio') or response.output.audio is None: raise RuntimeError("API call failed: response.output.audio is None or missing") audio_url = response.output.audio["url"] return audio_url except Exception as e: raise RuntimeError(f"Speech synthesis failed: {e}") def download_audio(audio_url, save_path): try: resp = requests.get(audio_url, timeout=10) resp.raise_for_status() with open(save_path, 'wb') as f: f.write(resp.content) print(f"Audio file saved to: {save_path}") except Exception as e: raise RuntimeError(f"Download failed: {e}") def main(): text = ( """哟,您猜怎么着?今儿个我看NBA,库里投篮跟闹着玩似的,张手就来,篮筐都得喊他“亲爹”了""" ) save_path = "downloaded_audio.wav" try: audio_url = synthesize_speech(text) download_audio(audio_url, save_path) except Exception as e: print(e) if __name__ == "__main__": main()
结语
Qwen-TTS是一款语音合成模型,支持中英双语以及几种中文方言的合成,致力于通过API提供自然且富有表现力的语音生成能力。尽管它目前已展现出良好性能,但我们期待未来能够进一步优化,并拓展对更多语言的支持。