Voxtral TTS
يعمل Voxtral 4B TTS 2603 محليًا على Apple Silicon عبر وحدة VoxtralTTS: 20 صوتًا مُعدًا مسبقًا وتسع لغات وصوت أحادي بتردد 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.wavواجهة Swift
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)
}واجهة الخادم
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.