mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-14 02:20:12 +01:00
b6be43be95
* Add Speech-to-text and Text-to-speech providers * add files and update comment * update comments * patch: bad playerRef check
16 lines
451 B
JavaScript
16 lines
451 B
JavaScript
function getTTSProvider() {
|
|
const provider = process.env.TTS_PROVIDER || "openai";
|
|
switch (provider) {
|
|
case "openai":
|
|
const { OpenAiTTS } = require("./openAi");
|
|
return new OpenAiTTS();
|
|
case "elevenlabs":
|
|
const { ElevenLabsTTS } = require("./elevenLabs");
|
|
return new ElevenLabsTTS();
|
|
default:
|
|
throw new Error("ENV: No TTS_PROVIDER value found in environment!");
|
|
}
|
|
}
|
|
|
|
module.exports = { getTTSProvider };
|