MCPcopy
hub / github.com/MiniMax-AI/cli / filterByLanguage

Function filterByLanguage

src/commands/speech/voices.ts:16–23  ·  view source on GitHub ↗
(voices: SystemVoiceInfo[], language: string)

Source from the content-addressed store, hash-verified

14}
15
16export function filterByLanguage(voices: SystemVoiceInfo[], language: string): SystemVoiceInfo[] {
17 const lang = language.toLowerCase();
18 return voices.filter(v => {
19 const voiceLang = extractLanguage(v.voice_id).toLowerCase();
20 // Exact prefix match: "english" matches "English_*" but not "Korean_*"
21 return voiceLang === lang || voiceLang.startsWith(lang + '_') || voiceLang.startsWith(lang + ' (');
22 });
23}
24
25export default defineCommand({
26 name: 'speech voices',

Callers 3

voices.test.tsFile · 0.90
voicesMethod · 0.90
runFunction · 0.85

Calls 1

extractLanguageFunction · 0.85

Tested by

no test coverage detected