@lobehub/tts
Version:
A high-quality & reliable TTS React Hooks library
14 lines (12 loc) • 513 B
JavaScript
import edgeVoiceList_default from "./edgeVoiceList.mjs";
import voiceList_default from "../data/voiceList.mjs";
import { flatten } from "es-toolkit/compat";
//#region src/core/EdgeSpeechTTS/options.ts
const getEdgeVoiceOptions = (locale) => {
return (locale && edgeVoiceList_default[locale] ? edgeVoiceList_default[locale] || [] : flatten(Object.values(edgeVoiceList_default))).map((voice) => ({
label: voiceList_default?.[voice] || voice,
value: voice
}));
};
//#endregion
export { getEdgeVoiceOptions };