Voxtral TTS
Voxtral 4B TTS 2603 chạy cục bộ trên Apple Silicon qua mô-đun VoxtralTTS: 20 giọng cài sẵn, chín ngôn ngữ và âm thanh đơn kênh 24 kHz.
Dòng lệnh
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.wavAPI 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)
}API máy chủ
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.pcmGiọng cài sẵn
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 |
Giới hạn và quản lý trạng thái
Chỉ hỗ trợ giọng có sẵn; chưa hỗ trợ nhân bản từ âm thanh tham chiếu. SDK, CLI, WebSocket và HTTP PCM xuất âm thanh trong khi tạo. Phải cung cấp toàn bộ văn bản đầu vào ngay từ đầu. Trọng số mô hình dùng giấy phép CC BY-NC 4.0.
Mỗi yêu cầu giữ riêng bộ nhớ đệm mô hình ngôn ngữ, lịch sử codec và hạt giống ngẫu nhiên. Hàm gọi lại đợi bên nhận xử lý trước khi tiếp tục. Mỗi đoạn mặc định có 3 khung (240 ms âm thanh), giới hạn 500 khung (40 giây). Lỗi có thể xảy ra sau khi đã xuất một phần âm thanh; chỉ khi hoàn tất bình thường mới gửi dấu kết thúc.
VoxtralTTSOptions(streamingChunkFrames: 3) · generateStreaming(onChunk:) · AudioChunk.isFinal.