extend_audio
Generate AI-powered audio continuations to extend music tracks or sound files by specifying duration, enabling longer compositions from existing audio.
Instructions
Extend an audio track using AI to generate continuation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to extend | |
| extension_duration | No | Duration to extend in seconds | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1140-1159 (handler)The handler function that implements the core logic for the 'extend_audio' tool. It validates input, makes a POST request to the '/extend' API endpoint with the audio URL and optional extension duration/webhook, and returns a status message with task details.private async handleExtendAudio(args: any) { if (!args.audio_url) { throw new McpError(ErrorCode.InvalidParams, "audio_url is required"); } const response = await this.axiosInstance.post("/extend", { audio_url: args.audio_url, extension_duration: args.extension_duration, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Audio extension started!\n\n${JSON.stringify(response.data, null, 2)}\n\nUse get_conversion_by_id with the task_id to check the status.`, }, ], }; }
- src/index.ts:445-466 (schema)The tool schema definition including name, description, and input schema for 'extend_audio', used for tool listing and validation.{ name: "extend_audio", description: "Extend an audio track using AI to generate continuation", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to extend", }, extension_duration: { type: "number", description: "Duration to extend in seconds", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url"], }, },
- src/index.ts:705-706 (registration)The dispatch case in the CallToolRequestSchema handler that routes 'extend_audio' tool calls to the handleExtendAudio method.case "extend_audio": return await this.handleExtendAudio(args);