MCPcopy Index your code
hub / github.com/MiniMax-AI/cli / extractLanguage

Function extractLanguage

src/commands/speech/voices.ts:9–14  ·  view source on GitHub ↗
(voiceId: string)

Source from the content-addressed store, hash-verified

7import type { VoiceListResponse, SystemVoiceInfo } from '../../types/api';
8
9function extractLanguage(voiceId: string): string {
10 // voice_id format: "Language_VoiceName" or "Language (Dialect)_VoiceName"
11 // Match up to the last underscore-separated word that starts with uppercase
12 const match = voiceId.match(/^(.+?)_[A-Z]/);
13 return match ? match[1] : voiceId;
14}
15
16export function filterByLanguage(voices: SystemVoiceInfo[], language: string): SystemVoiceInfo[] {
17 const lang = language.toLowerCase();

Callers 1

filterByLanguageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected