voice_changer
Convert audio files to different voices using AI voice models. Upload audio, select a target voice ID, and transform vocal characteristics for creative or practical applications.
Instructions
Convert audio from one voice to another using AI voice models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to convert | |
| voice_id | Yes | Target voice model ID (use get_all_voices to find IDs) | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:900-919 (handler)The handler function that implements the core logic for the voice_changer tool. It validates inputs, makes a POST request to the MusicGPT API's /voicetovoice endpoint, and returns the task details with instructions for status checking.private async handleVoiceChanger(args: any) { if (!args.audio_url || !args.voice_id) { throw new McpError(ErrorCode.InvalidParams, "audio_url and voice_id are required"); } const response = await this.axiosInstance.post("/voicetovoice", { audio_url: args.audio_url, voice_id: args.voice_id, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Voice conversion 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:211-226 (schema)Input schema defining the parameters for the voice_changer tool: audio_url (required), voice_id (required), and optional webhook_url.type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to convert", }, voice_id: { type: "string", description: "Target voice model ID (use get_all_voices to find IDs)", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "voice_id"],
- src/index.ts:207-228 (registration)Tool registration entry in the TOOLS array, which is returned by the listTools handler. Includes name, description, and input schema.{ name: "voice_changer", description: "Convert audio from one voice to another using AI voice models", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to convert", }, voice_id: { type: "string", description: "Target voice model ID (use get_all_voices to find IDs)", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "voice_id"], }, },
- src/index.ts:677-678 (registration)Switch case in the CallToolRequestSchema handler that routes execution to the specific handleVoiceChanger method.case "voice_changer": return await this.handleVoiceChanger(args);