mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-25 14:46:44 +00:00
feat: add Speechify TTS driver (puter-tts) (#3453)
* feat: add Speechify TTS driver Adds a SpeechifyTTSProvider under the ai-tts driver (mirrors the xAI/ ElevenLabs REST-provider shape), registered in TTSDriver alongside the existing providers. Wires puter-js txt2speech with provider: "speechify" support, default voice/model, and the speechify-tts driver alias. Every outbound request sets Speechify-Caller: puter; base URL is https://api.speechify.ai only; default model is simba-3.2. * fix: replace placeholder voice IDs with real simba-3.2/simba-english voices DEFAULT_VOICE and the starter voice catalog used invalid IDs (henry, cliff, kristy, george, aria) that the real API rejects with 400. Swapped in confirmed-real voices from a live GET /v1/voices call: geffen_32, dominic_32, harper_32, hugh_32, imogen_32, and alec for the simba-english model-override test. * fix: purge remaining placeholder voice IDs from client, docs, and types The previous fix only covered the backend provider — the client-side default in tts.js, its test, the txt2speech docs page, and the ai.d.ts type comment all still referenced the invalid henry/cliff/kristy/george/ aria set. All replaced with the live-verified voices (geffen_32 default). Also corrects the docs link to docs.speechify.ai.
This commit is contained in:
@@ -32,7 +32,7 @@ Additional settings for the generation request. Available options depend on the
|
||||
|
||||
| Option | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `provider` | `String` | TTS provider to use. `'aws-polly'` (default), `'openai'`, `'elevenlabs'`, `'gemini'`, `'xai'` |
|
||||
| `provider` | `String` | TTS provider to use. `'aws-polly'` (default), `'openai'`, `'elevenlabs'`, `'gemini'`, `'xai'`, `'speechify'` |
|
||||
| `model` | `String` | Model identifier (provider-specific) |
|
||||
| `voice` | `String` | Voice ID used for synthesis (provider-specific) |
|
||||
| `test_mode` | `Boolean` | When `true`, returns a sample audio without using credits |
|
||||
@@ -100,6 +100,18 @@ Text supports inline speech tags like `[pause]`, `[laugh]` and wrapping tags lik
|
||||
|
||||
For more details, see the [xAI TTS documentation](https://x.ai/news/grok-stt-and-tts-apis).
|
||||
|
||||
#### Speechify Options
|
||||
|
||||
Available when `provider: 'speechify'`:
|
||||
|
||||
| Option | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `model` | `String` | TTS model. Available: `'simba-3.2'` (default), `'simba-english'`, `'simba-multilingual'` |
|
||||
| `voice` | `String` | Voice ID. Available: `'geffen_32'` (default), `'dominic_32'`, `'harper_32'`, `'hugh_32'`, `'imogen_32'` |
|
||||
| `output_format` | `String` | Output format. Available: `'mp3'` (default), `'wav'`, `'ogg'`, `'aac'` |
|
||||
|
||||
For more details, see the [Speechify API documentation](https://docs.speechify.ai/).
|
||||
|
||||
## Return value
|
||||
|
||||
A `Promise` that resolves to an `HTMLAudioElement`. The element’s `src` points at a blob or remote URL containing the synthesized audio.
|
||||
@@ -246,6 +258,30 @@ A `Promise` that resolves to an `HTMLAudioElement`. The element’s `src` points
|
||||
</html>
|
||||
```
|
||||
|
||||
<strong class="example-title">Use Speechify voices</strong>
|
||||
|
||||
```html;ai-txt2speech-speechify
|
||||
<html>
|
||||
<body>
|
||||
<script src="https://js.puter.com/v2/"></script>
|
||||
<button id="play">Use Speechify voice</button>
|
||||
<script>
|
||||
document.getElementById('play').addEventListener('click', async ()=>{
|
||||
const audio = await puter.ai.txt2speech(
|
||||
"Hello! This sample uses the Speechify Geffen voice.",
|
||||
{
|
||||
provider: "speechify",
|
||||
model: "simba-3.2",
|
||||
voice: "geffen_32"
|
||||
}
|
||||
);
|
||||
audio.play();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
<strong class="example-title">Compare different engines</strong>
|
||||
|
||||
```html;ai-txt2speech-engines
|
||||
|
||||
Reference in New Issue
Block a user