- Visão geral
- Características
- -Preços.
- Limites de Taxa
- Referência da API [Modelo Marketplace] (https://www.qwencloud.com/models)
Qwen3-TTS-Flash-Realtime
qwen3-tts-flash-realtime
- Copia o sucesso! Chame a API.https://www.qwencloud.com/compare?models=qwen3-tts-flash-realtime Adicionar para comparar Simplex Real-Time Speech Synthesis Simplex Real-Time Speech Synthesis 1+
Visão geral
Transforma texto em fala para narração, assistentes e experiências de áudio. A saída em tempo real permite começar a reproduzir a voz durante a geração.
Características
Prefixo Completação
Activar o Modo Parcial ao chamar o Qwen API para fazer o modelo continuar estritamente do seu prefixo fornecido texto.https://docs.qwencloud.com/developer-guides/text-generation/partial-mode)
Chamada de Função
Use a função chamando para conectar modelos de linguagem com ferramentas e sistemas externos.https://docs.qwencloud.com/developer-guides/text-generation/function-calling)
Cache.
Contexto Cache armazena prefixos compartilhados para pedidos de longo contexto para reduzir a computação repetida, melhorar a latência e menor custo.https://docs.qwencloud.com/developer-guides/text-generation/context-cache#implicit-cache)
Saídas Estruturadas
Saídas estruturadas ajudam a garantir que o modelo retorne uma string JSON no formato esperado.https://docs.qwencloud.com/developer-guides/text-generation/structured-output)
Batches.
Processa assíncronamente pedidos em lotes para reduzir custos.https://docs.qwencloud.com/developer-guides/run-and-scale/cost-optimization#batch-calling)
Pesquisa na Web
Active a busca na web para que o modelo possa responder com dados recuperados em tempo real.https://docs.qwencloud.com/developer-guides/text-generation/web-search#enable-web-search)
Afinação
Modelos de trens em dados amostrais para melhor adaptá-los a tarefas específicas.https://docs.qwencloud.com/developer-guides/fine-tuning/overview)
-Preços.
- TTS $0.13 (≈ R$ 0,652639*) Por 10.000 caracteres
Limites de Taxa
- RPM pede por minuto 180
Referência da API
[Ligar API] (https://home.qwencloud.com/api-keys) DashScope Java Python Python
- Copia o sucesso! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
import os
import base64
import threading
import time
import dashscope
from dashscope.audio.qwen_tts_realtime import *
qwen_tts_realtime: QwenTtsRealtime = None
text_to_synthesize = [
'Right?~ I especially love this kind of supermarket,',
'Especially during the New Year',
'Going to the supermarket',
'It just makes me feel',
'Super, super happy!',
'I want to buy so many things!'
]
DO_VIDEO_TEST = False
def init_dashscope_api_key ():
"""
Set your DashScope API-key. More information:
https://github.com/aliyun/alibabacloud-bailian-speech-demo/blob/master/PREREQUISITES.md
"""
if 'DASHSCOPE_API_KEY' in os.environ:
dashscope.api_key = os.environ[
'DASHSCOPE_API_KEY'] # load API-key from environment variable DASHSCOPE_API_KEY
else:
dashscope.api_key = 'your-dashscope-api-key' # set API-key manually
class MyCallback (QwenTtsRealtimeCallback):
def __init__(self):
self.complete_event = threading.Event()
self.file = open ('result_24k.pcm', 'wb')
def on_open (self) -> None:
print ('connection opened, init player')
def on_close (self, close_status_code, close_msg) -> None:
self.file.close()
print ('connection closed with code: {}, msg: {}, destroy player'.format (close_status_code, close_msg))
def on_event (self, response: str) -> None:
try:
global qwen_tts_realtime
type = response['type']
if 'session.created' == type:
print ('start session: {}'.format (response['session']['id']))
if 'response.audio.delta' == type:
recv_audio_b64 = response['delta']
self.file.write(base64.b64decode(recv_audio_b64))
if 'response.done' == type:
print (f'response {qwen_tts_realtime.get_last_response_id()} done')
if 'session.finished' == type:
print ('session finished')
self.complete_event.set ()
except Exception as e:
print ('[Error] {}'.format (e))
return
def wait_for_finished (self):
self.complete_event.wait()
if __name__ == '__main__':
init_dashscope_api_key()
print ('Initializing ...')
callback = MyCallback()
qwen_tts_realtime = QwenTtsRealtime(
model='qwen3-tts-flash-realtime',
callback=callback,
)
qwen_tts_realtime.connect()
qwen_tts_realtime.update_session(
voice = 'Cherry',
response_format = AudioFormat.PCM_24000HZ_MONO_16BIT,
mode = 'server_commit'
)
for text_chunk in text_to_synthesize:
print (f'send texd: {text_chunk}')
qwen_tts_realtime.append_text(text_chunk)
time.sleep(0.1)
qwen_tts_realtime.finish()
callback.wait_for_finished()
print ('[Metric] session: {}, first audio delay: {}'.format (
qwen_tts_realtime.get_session_id(),
qwen_tts_realtime.get_first_audio_delay(),
))
Cota Livre 10 mil de desconto. [Assinar para rastrear o uso] (https://account.qwencloud.com/sso/OIDCAuth?oauth_callback=https%3A%2F%2Fwww.qwencloud.com%2Fmodels%2Fqwen3-tts-flash-realtime)
- Entrada: Texto
- Saída: Áudio
- Características:
- Preço: $0.13 (≈ R$ 0,652639*)/10.000 caracteres
- RPM: 180
- TPM:
- Entrada máxima:
- Saída Máxima:
- Janela de contexto:
- Versão Tag: MAJOR
- Autor modelo: Alibaba.
- Provedor de inferência: Alibaba-nuvem-modelosestudio
- Atualizado em: 26 de Nov de 2025 Qwen3-TTS-Flash-Realtime qwen3-tts-flash-realtime
- Copia o sucesso! Destaques