change_audio_speed
Adjust audio playback speed by specifying a multiplier to slow down or speed up audio files from a URL.
Instructions
Change the playback speed of audio
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to process | |
| speed_factor | Yes | Speed multiplier (e.g., 1.5 for 1.5x speed, 0.75 for 0.75x speed) | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1078-1097 (handler)Handler function that validates the input arguments (audio_url and speed_factor), sends a POST request to the '/audio_speed_changer' API endpoint with optional webhook_url, and returns a text response with the task details and instructions to check status.private async handleChangeAudioSpeed(args: any) { if (!args.audio_url || !args.speed_factor) { throw new McpError(ErrorCode.InvalidParams, "audio_url and speed_factor are required"); } const response = await this.axiosInstance.post("/audio_speed_changer", { audio_url: args.audio_url, speed_factor: args.speed_factor, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Audio speed change 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:386-403 (schema)Input schema defining the parameters for the change_audio_speed tool: required audio_url (string) and speed_factor (number), optional webhook_url (string).inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to process", }, speed_factor: { type: "number", description: "Speed multiplier (e.g., 1.5 for 1.5x speed, 0.75 for 0.75x speed)", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "speed_factor"], },
- src/index.ts:383-404 (registration)Tool definition in the TOOLS constant array, which is returned by the listTools handler. Includes name, description, and inputSchema.{ name: "change_audio_speed", description: "Change the playback speed of audio", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to process", }, speed_factor: { type: "number", description: "Speed multiplier (e.g., 1.5 for 1.5x speed, 0.75 for 0.75x speed)", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "speed_factor"], }, },
- src/index.ts:699-700 (registration)Switch case in the callTool request handler that dispatches execution of 'change_audio_speed' to the specific handler method.case "change_audio_speed": return await this.handleChangeAudioSpeed(args);