Download docs/API.md from Fealtyy/morisyen-tts: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/Fealtyy/morisyen-tts/resolve/main/docs/API.md
- Command line
-
hf download hf://Fealtyy/morisyen-tts/docs/API.md
-
curl -L -o API.md https://huggingface.co/Fealtyy/morisyen-tts/resolve/main/docs/API.md
API reference
All URLs below are relative to your Morisyen TTS service URL.
Health
GET /health
{"status": "ok"}
This is a service liveness response. It does not confirm model readiness or audio quality.
Complete synthesis
POST /synthesize
Request header: Content-Type: application/json.
{"gen_text": "Bonzur! Kouma ou ete zordi?"}
gen_text is a required, non-empty string. Successful responses contain:
| Field | Meaning |
|---|---|
audio_base64 |
Base64-encoded complete WAV file |
content_type |
audio/wav |
sample_rate |
8000 Hz |
encoding |
PCM_16 |
duration_seconds |
Generated audio duration in seconds |
byte_size |
WAV file length in bytes |
Decode audio_base64 and save the bytes as a .wav file. The base64 text is not the audio file itself.
Invalid or missing input returns an HTTP error, commonly 400 or 422. Synthesis failures return 500. Authentication and access controls, if configured, depend on your deployment.
Streaming synthesis
WS /ws/synthesize
- Connect to the WebSocket endpoint.
- Send one JSON text frame containing
gen_text. - Consume binary frames; each frame is a complete mono PCM16 WAV chunk at 8,000 Hz.
- Read the final JSON summary and allow the connection to close.
An error is delivered as a JSON frame with an error field. Summary fields can vary by service version. Audio duration and request latency are different measurements.
For continuous playback, extract each WAV chunk's PCM frames before appending them to your audio buffer. Use client.stream(text) to perform that conversion automatically.