generate_speech
Convert text to speech audio using a specific voice replica for video content, conversational AI, and multimedia projects.
Instructions
Generate speech audio from text using a replica
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| replica_id | Yes | Replica to use for speech generation | |
| script | Yes | Text script to convert to speech | |
| speech_name | No | Name for the generated speech | |
| callback_url | No | URL to receive completion callback |
Implementation Reference
- src/index.ts:1045-1053 (handler)The main handler function that executes the generate_speech tool logic. It makes a POST request to the '/speech' API endpoint with the provided arguments and returns the response as formatted JSON.
private async generateSpeech(args: any) { const response = await this.axiosInstance.post('/speech', args); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } - src/index.ts:603-629 (schema)The input schema definition for the generate_speech tool, defining the required parameters: replica_id (required), script (required), speech_name (optional), and callback_url (optional).
// Speech { name: 'generate_speech', description: 'Generate speech audio from text using a replica', inputSchema: { type: 'object', properties: { replica_id: { type: 'string', description: 'Replica to use for speech generation', }, script: { type: 'string', description: 'Text script to convert to speech', }, speech_name: { type: 'string', description: 'Name for the generated speech', }, callback_url: { type: 'string', description: 'URL to receive completion callback', }, }, required: ['replica_id', 'script'], }, }, - src/index.ts:750-751 (registration)The switch-case routing that maps the 'generate_speech' tool name to its handler method generateSpeech().
case 'generate_speech': return await this.generateSpeech(request.params.arguments);