Voxtral TTS
Voxtral 4B TTS 2603 通过 VoxtralTTS 模块在 Apple Silicon 上本地运行,提供 20 种预设声音、9 种语言和 24 kHz 单声道语音。
命令行
speech speak "Hello, welcome to Voxtral." --engine voxtral --voxtral-voice casual_male --stream --voxtral-chunk-frames 3 -o hello.wav
speech speak --engine voxtral --list-speakers
speech speak "Bonjour." --engine voxtral --voxtral-voice fr_female --voxtral-max-frames 500 --voxtral-seed 0 -o bonjour.wavSwift API
import VoxtralTTS
let model = try await VoxtralTTSModel.fromPretrained()
for try await chunk in model.generateStream(text: "Hello, welcome to Voxtral.", voice: "casual_male") {
print(chunk.frameIndex, chunk.samples.count, chunk.isFinal)
}服务器 API
curl http://localhost:8080/v1/audio/speech \
-H 'Content-Type: application/json' \
-d '{"model":"voxtral-tts","input":"Hello, welcome to Voxtral.","voice":"casual_male","response_format":"wav"}' \
-o hello.wav/v1/realtime: session.update → {"model":"voxtral-tts","voice":"casual_male"}; response.create → {"instructions":"Hello, welcome to Voxtral."}.
curl http://localhost:8080/v1/audio/speech \
-H 'Content-Type: application/json' \
-d '{"model":"voxtral-tts","input":"Hello, welcome to Voxtral.","voice":"casual_male","stream":true,"response_format":"pcm"}' \
-o hello.pcm预设声音
en | casual_male, casual_female, cheerful_female, neutral_male, neutral_female |
fr | fr_male, fr_female |
es | es_male, es_female |
de | de_male, de_female |
it | it_male, it_female |
pt | pt_male, pt_female |
nl | nl_male, nl_female |
ar | ar_male |
hi | hi_male, hi_female |
限制与状态管理
仅支持预设音色,不支持参考音频克隆。SDK、CLI、WebSocket 和 HTTP PCM 均可在生成过程中输出音频。输入文本须一次性完整提供。模型权重采用 CC BY-NC 4.0 许可。
每个请求独立持有语言模型缓存、编解码器历史和随机种子。回调会等待使用方处理完成后再继续生成。默认每块为 3 帧(240 毫秒音频),上限为 500 帧(40 秒)。流式生成可能在已输出部分音频后失败;只有正常结束才会发送最终标记。
VoxtralTTSOptions(streamingChunkFrames: 3) · generateStreaming(onChunk:) · AudioChunk.isFinal.