-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-integration.js
More file actions
65 lines (54 loc) · 2.03 KB
/
Copy pathtest-integration.js
File metadata and controls
65 lines (54 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env node
/**
* Integration test for Neurolink TTS compatibility
*/
import { VoiceTestService } from './dist/src/index.js';
import dotenv from 'dotenv';
dotenv.config();
async function testIntegration() {
console.log('\n🧪 Testing Neurolink Integration...\n');
try {
// Test 1: Initialize service
console.log('✓ Test 1: Initialize VoiceTestService');
const service = VoiceTestService.create();
console.log(' ✅ Service initialized successfully\n');
// Test 2: Generate speech
console.log('✓ Test 2: Generate speech with TTS');
const audioPath = await service.generateSpeech({
text: 'This is a test of neurolink TTS integration.',
languageCode: 'en-US',
voiceName: 'en-US-Neural2-D',
audioEncoding: 'MP3',
play: false,
});
console.log(` ✅ Audio generated: ${audioPath}\n`);
// Test 3: Generate with background
console.log('✓ Test 3: Generate speech with background mixing');
const mixedPath = await service.generateSpeech({
text: 'Testing background audio mixing with neurolink.',
languageCode: 'en-US',
voiceName: 'en-US-Neural2-D',
audioEncoding: 'WAV',
backgroundSound: 'office',
backgroundVolume: 0.2,
play: false,
});
console.log(` ✅ Mixed audio generated: ${mixedPath}\n`);
// Test 4: Get voices
console.log('✓ Test 4: Get available voices');
const voices = await service.getAvailableVoices('en-US');
console.log(` ✅ Found ${voices.length} voices for en-US\n`);
// Test 5: Get system info
console.log('✓ Test 5: Get system information');
const info = service.getSystemInfo();
console.log(` ✅ TTS Provider: ${info.ttsProvider}`);
console.log(` ✅ STT Provider: ${info.sttProvider}`);
console.log(` ✅ Version: ${info.voiceTestVersion}\n`);
console.log('🎉 All integration tests passed!\n');
process.exit(0);
} catch (error) {
console.error('❌ Integration test failed:', error.message);
process.exit(1);
}
}
testIntegration();