Skip to main content
Glama

change_audio_speed

Adjust audio playback speed by applying a speed multiplier to audio files. Modify tempo for faster or slower listening without altering pitch.

Instructions

Change the playback speed of audio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to process
speed_factorYesSpeed multiplier (e.g., 1.5 for 1.5x speed, 0.75 for 0.75x speed)
webhook_urlNoURL for callback upon completion

Implementation Reference

  • The handler function that implements the core logic for the 'change_audio_speed' tool. It validates input parameters, makes a POST request to the '/audio_speed_changer' API endpoint with the provided audio_url, speed_factor, and optional webhook_url, and returns a response message including the task_id for status checking.
    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.`,
          },
        ],
      };
    }
  • Input schema defining the parameters for the 'change_audio_speed' tool: required audio_url (string) and speed_factor (number), optional webhook_url (string). Used for validation and tool description.
    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 registration entry in the TOOLS array, which is returned by the ListTools handler. Includes name, description, and input schema.
    {
      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 CallToolRequestSchema handler that routes calls to 'change_audio_speed' to the specific handleChangeAudioSpeed method.
    case "change_audio_speed":
      return await this.handleChangeAudioSpeed(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pasie15/mcp-server-musicgpt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server