textToSpeech( )
Converts text to speech audio.
function textToSpeech(params): object;
| Name | Type | Required? | Description |
|---|
| params | object | ✓ | Text-to-speech parameters |
| Field | Type | Required? | Description |
|---|
| modelId | string | ✓ | Model identifier |
| text | string | ✓ | Text to convert to speech |
| inputType | string | ✓ | Input type (e.g., "text") |
| stream | boolean | ✓ | Whether to stream the audio |
object — Object with bufferStream generator, buffer promise, and done promise
| Field | Type | Description |
|---|
| buffer | Promise<number[]> | Complete audio buffer |
| bufferStream | AsyncGenerator<number> | Stream of audio samples |
| done | Promise<boolean> | Promise indicating completion |