test_voice_packs
Test all voice packs by playing sample achievements to verify audio setup, compare voice styles, and ensure proper functionality.
Instructions
๐งช Test all voice packs by playing a sample achievement from each voice pack (male and female). Useful for verifying audio setup, comparing voice styles, or ensuring all voice packs are working correctly. Plays one achievement from each voice pack sequentially.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| volume | No | ๐ Volume level for test audio playback (0-100). Default is 80. Examples: 50, 80, 100 |
Implementation Reference
- index.js:854-900 (handler)Main handler function that tests all available voice packs by playing the specified achievement sound with each voice pack and collects results.async testVoicePacks(args) { const { achievement = "EXCELLENT" } = args; if (!ENHANCED_ACHIEVEMENTS[achievement]) { const available = Object.keys(ENHANCED_ACHIEVEMENTS).join(", "); throw new McpError( ErrorCode.InvalidParams, `โ Unknown achievement: ${achievement}. Available: ${available}` ); } const testResults = []; for (const [voiceId, voiceInfo] of Object.entries(VOICE_PACKS)) { try { // ๐ช Test each voice pack await EnhancedSoundOracle.playAchievementSound(achievement, 70, voiceId); testResults.push({ voiceId: voiceId, voiceName: voiceInfo.displayName, status: "success", message: `โ ${voiceInfo.displayName} played successfully` }); // Wait a moment between voices await new Promise(resolve => setTimeout(resolve, 1500)); } catch (error) { testResults.push({ voiceId: voiceId, voiceName: voiceInfo.displayName, status: "error", message: `โ ${voiceInfo.displayName} failed: ${error.message}` }); } } return { success: true, message: `๐งช Tested all voice packs with ${achievement}!`, testAchievement: achievement, testResults: testResults, totalVoices: Object.keys(VOICE_PACKS).length, successfulTests: testResults.filter(r => r.status === "success").length }; }
- index.js:398-411 (schema)Input schema definition for the test_voice_packs tool, including parameters and validation.name: "test_voice_packs", description: "๐งช Test all available voice packs with a sample achievement", inputSchema: { type: "object", properties: { achievement: { type: "string", description: "๐ Achievement to test with (default: EXCELLENT)", enum: Object.keys(ENHANCED_ACHIEVEMENTS), default: "EXCELLENT", }, }, }, },
- index.js:238-239 (registration)Registration in the tool dispatcher switch statement that routes calls to the testVoicePacks handler.case "test_voice_packs": return await this.testVoicePacks(args);
- src/tools/guides.ts:126-180 (helper)Alternative or additional registration of test_voice_packs tool with different schema (volume param) and simplified test logic for male/female voices.server.registerTool( "test_voice_packs", { description: "๐งช Test all voice packs by playing a sample achievement from each voice pack (male and female). Useful for verifying audio setup, comparing voice styles, or ensuring all voice packs are working correctly. Plays one achievement from each voice pack sequentially.", inputSchema: { volume: z.number().min(0).max(100).default(80).describe("๐ Volume level for test audio playback (0-100). Default is 80. Examples: 50, 80, 100"), }, annotations: { title: "๐งช Test Voice Packs", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true } }, async ({ volume }) => { const results = []; // Test male voice with a common achievement try { await EnhancedSoundOracle.playAchievementSound("RAMPAGE", volume, "male", "male"); results.push({ voice: "male", achievement: "RAMPAGE", status: "success" }); } catch (error) { results.push({ voice: "male", achievement: "RAMPAGE", status: "error", error: error instanceof Error ? error.message : String(error) }); } // Small delay between sounds await new Promise(resolve => setTimeout(resolve, 1000)); // Test female voice with a common achievement try { await EnhancedSoundOracle.playAchievementSound("RAMPAGE", volume, "female", "female"); results.push({ voice: "female", achievement: "RAMPAGE", status: "success" }); } catch (error) { results.push({ voice: "female", achievement: "RAMPAGE", status: "error", error: error instanceof Error ? error.message : String(error) }); } const successCount = results.filter(r => r.status === "success").length; const allSuccess = successCount === results.length; return { content: [{ type: "text", text: `๐งช Voice Pack Test Results:\n\n${results.map(r => `๐ค ${r.voice.toUpperCase()}: ${r.status === "success" ? "โ Success" : `โ Error: ${r.error}`}` ).join('\n')}\n\n${allSuccess ? "๐ All voice packs working correctly!" : "โ ๏ธ Some voice packs had issues. Check error messages above."}` }], results, successCount, totalTests: results.length, allSuccess }; } ); }