#!/usr/bin/env node
import { playSoundEffect, getSoundEffectList, SoundEffect } from './src/sound.js';
async function testSoundEffect(sound: SoundEffect) {
console.log(`๐งช ${sound}้ณใฎใในใใ้ๅง...`);
try {
const startTime = Date.now();
await playSoundEffect(sound);
const endTime = Date.now();
console.log(`โ
${sound}้ณใฎๅ็ๆๅ๏ผ (${endTime - startTime}ms)`);
} catch (error) {
console.log(`โ ${sound}้ณใฎๅ็ๅคฑๆ:`, error instanceof Error ? error.message : String(error));
}
}
async function testListSoundEffects() {
console.log('๐งช ๅนๆ้ณใชในใใฎใในใใ้ๅง...');
try {
const effects = getSoundEffectList();
console.log('โ
ๅนๆ้ณใชในใๅๅพๆๅ:');
effects.forEach(effect => {
console.log(` โข ${effect.name}: ${effect.description}`);
});
return effects;
} catch (error) {
console.log('โ ๅนๆ้ณใชในใๅๅพๅคฑๆ:', error instanceof Error ? error.message : String(error));
return [];
}
}
async function main() {
console.log('๐ต MCPใตใผใใผๅ
้จๅฆ็ใในใ้ๅง\n');
// 1. ๅนๆ้ณใชในใใฎใในใ
const effects = await testListSoundEffects();
console.log('');
// 2. ๅๅนๆ้ณใฎใในใ
for (const effect of effects) {
await testSoundEffect(effect.name);
console.log('');
// ้ณๅฃฐๅ็ใฎ้้ใ็ฉบใใ
await new Promise(resolve => setTimeout(resolve, 2000));
}
console.log('๐ ใในใๅฎไบ๏ผ');
}
main().catch(console.error);