Voxtral TTS
Voxtral 4B TTS 2603 ทำงานในเครื่องบน Apple Silicon ผ่านโมดูล VoxtralTTS รองรับเสียงที่ตั้งไว้ล่วงหน้า 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
แต่ละคำขอมีแคชโมเดลภาษา ประวัติโคเดก และค่า seed ของตนเอง การส่งผ่าน callback จะรอให้ผู้รับประมวลผลก่อนสร้างต่อ ค่าเริ่มต้นแต่ละช่วงมี 3 เฟรม (เสียง 240 มิลลิวินาที) และจำกัดที่ 500 เฟรม (40 วินาที) อาจเกิดข้อผิดพลาดหลังส่งเสียงบางส่วนแล้ว โดยส่งเครื่องหมายสุดท้ายเฉพาะเมื่อจบตามปกติเท่านั้น
VoxtralTTSOptions(streamingChunkFrames: 3) · generateStreaming(onChunk:) · AudioChunk.isFinal.