Revert aligning voice_id name in TTS service constructor
This commit is contained in:
@@ -50,7 +50,7 @@ async def main():
|
|||||||
|
|
||||||
stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"))
|
stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"))
|
||||||
|
|
||||||
tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice_id="aura-helios-en")
|
tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-helios-en")
|
||||||
|
|
||||||
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ async def main():
|
|||||||
tts = PlayHTTTSService(
|
tts = PlayHTTTSService(
|
||||||
user_id=os.getenv("PLAYHT_USER_ID"),
|
user_id=os.getenv("PLAYHT_USER_ID"),
|
||||||
api_key=os.getenv("PLAYHT_API_KEY"),
|
api_key=os.getenv("PLAYHT_API_KEY"),
|
||||||
voice_id="s3://voice-cloning-zero-shot/801a663f-efd0-4254-98d0-5c175514c3e8/jennifer/manifest.json",
|
voice_url="s3://voice-cloning-zero-shot/801a663f-efd0-4254-98d0-5c175514c3e8/jennifer/manifest.json",
|
||||||
)
|
)
|
||||||
|
|
||||||
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ async def main():
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
tts = OpenAITTSService(api_key=os.getenv("OPENAI_API_KEY"), voice_id="alloy")
|
tts = OpenAITTSService(api_key=os.getenv("OPENAI_API_KEY"), voice="alloy")
|
||||||
|
|
||||||
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ async def main():
|
|||||||
tts = DeepgramTTSService(
|
tts = DeepgramTTSService(
|
||||||
aiohttp_session=session,
|
aiohttp_session=session,
|
||||||
api_key=os.getenv("DEEPGRAM_API_KEY"),
|
api_key=os.getenv("DEEPGRAM_API_KEY"),
|
||||||
voice_id="aura-asteria-en",
|
voice="aura-asteria-en",
|
||||||
base_url="http://0.0.0.0:8080/v1/speak",
|
base_url="http://0.0.0.0:8080/v1/speak",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class AzureTTSService(TTSService):
|
|||||||
*,
|
*,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
region: str,
|
region: str,
|
||||||
voice_id="en-US-SaraNeural",
|
voice="en-US-SaraNeural",
|
||||||
sample_rate: int = 16000,
|
sample_rate: int = 16000,
|
||||||
params: InputParams = InputParams(),
|
params: InputParams = InputParams(),
|
||||||
**kwargs,
|
**kwargs,
|
||||||
@@ -200,7 +200,7 @@ class AzureTTSService(TTSService):
|
|||||||
"volume": params.volume,
|
"volume": params.volume,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.set_voice(voice_id)
|
self.set_voice(voice)
|
||||||
|
|
||||||
def can_generate_metrics(self) -> bool:
|
def can_generate_metrics(self) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class DeepgramTTSService(TTSService):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
voice_id: str = "aura-helios-en",
|
voice: str = "aura-helios-en",
|
||||||
sample_rate: int = 16000,
|
sample_rate: int = 16000,
|
||||||
encoding: str = "linear16",
|
encoding: str = "linear16",
|
||||||
**kwargs,
|
**kwargs,
|
||||||
@@ -60,7 +60,7 @@ class DeepgramTTSService(TTSService):
|
|||||||
"sample_rate": sample_rate,
|
"sample_rate": sample_rate,
|
||||||
"encoding": encoding,
|
"encoding": encoding,
|
||||||
}
|
}
|
||||||
self.set_voice(voice_id)
|
self.set_voice(voice)
|
||||||
self._deepgram_client = DeepgramClient(api_key=api_key)
|
self._deepgram_client = DeepgramClient(api_key=api_key)
|
||||||
|
|
||||||
def can_generate_metrics(self) -> bool:
|
def can_generate_metrics(self) -> bool:
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ class OpenAITTSService(TTSService):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
api_key: str | None = None,
|
api_key: str | None = None,
|
||||||
voice_id: str = "alloy",
|
voice: str = "alloy",
|
||||||
model: Literal["tts-1", "tts-1-hd"] = "tts-1",
|
model: Literal["tts-1", "tts-1-hd"] = "tts-1",
|
||||||
sample_rate: int = 24000,
|
sample_rate: int = 24000,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
@@ -392,7 +392,7 @@ class OpenAITTSService(TTSService):
|
|||||||
"sample_rate": sample_rate,
|
"sample_rate": sample_rate,
|
||||||
}
|
}
|
||||||
self.set_model_name(model)
|
self.set_model_name(model)
|
||||||
self.set_voice(voice_id)
|
self.set_voice(voice)
|
||||||
|
|
||||||
self._client = AsyncOpenAI(api_key=api_key)
|
self._client = AsyncOpenAI(api_key=api_key)
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ except ModuleNotFoundError as e:
|
|||||||
|
|
||||||
class PlayHTTTSService(TTSService):
|
class PlayHTTTSService(TTSService):
|
||||||
def __init__(
|
def __init__(
|
||||||
self, *, api_key: str, user_id: str, voice_id: str, sample_rate: int = 16000, **kwargs
|
self, *, api_key: str, user_id: str, voice_url: str, sample_rate: int = 16000, **kwargs
|
||||||
):
|
):
|
||||||
super().__init__(sample_rate=sample_rate, **kwargs)
|
super().__init__(sample_rate=sample_rate, **kwargs)
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class PlayHTTTSService(TTSService):
|
|||||||
"format": Format.FORMAT_WAV,
|
"format": Format.FORMAT_WAV,
|
||||||
"voice_engine": "PlayHT2.0-turbo",
|
"voice_engine": "PlayHT2.0-turbo",
|
||||||
}
|
}
|
||||||
self.set_voice(voice_id)
|
self.set_voice(voice_url)
|
||||||
self._options = TTSOptions(
|
self._options = TTSOptions(
|
||||||
voice=self._voice_id,
|
voice=self._voice_id,
|
||||||
sample_rate=self._settings["sample_rate"],
|
sample_rate=self._settings["sample_rate"],
|
||||||
|
|||||||
Reference in New Issue
Block a user