Skip to content

Commit

Permalink
Revert aligning voice_id name in TTS service constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
markbackman committed Oct 2, 2024
1 parent d75a02d commit 3d642df
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/foundational/07c-interruptible-deepgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def main():

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")

Expand Down
2 changes: 1 addition & 1 deletion examples/foundational/07e-interruptible-playht.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def main():
tts = PlayHTTTSService(
user_id=os.getenv("PLAYHT_USER_ID"),
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")
Expand Down
2 changes: 1 addition & 1 deletion examples/foundational/07g-interruptible-openai-tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion examples/foundational/16-gpu-container-local-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def main():
tts = DeepgramTTSService(
aiohttp_session=session,
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",
)

Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __init__(
*,
api_key: str,
region: str,
voice_id="en-US-SaraNeural",
voice="en-US-SaraNeural",
sample_rate: int = 16000,
params: InputParams = InputParams(),
**kwargs,
Expand All @@ -200,7 +200,7 @@ def __init__(
"volume": params.volume,
}

self.set_voice(voice_id)
self.set_voice(voice)

def can_generate_metrics(self) -> bool:
return True
Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/deepgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self,
*,
api_key: str,
voice_id: str = "aura-helios-en",
voice: str = "aura-helios-en",
sample_rate: int = 16000,
encoding: str = "linear16",
**kwargs,
Expand All @@ -60,7 +60,7 @@ def __init__(
"sample_rate": sample_rate,
"encoding": encoding,
}
self.set_voice(voice_id)
self.set_voice(voice)
self._deepgram_client = DeepgramClient(api_key=api_key)

def can_generate_metrics(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def __init__(
self,
*,
api_key: str | None = None,
voice_id: str = "alloy",
voice: str = "alloy",
model: Literal["tts-1", "tts-1-hd"] = "tts-1",
sample_rate: int = 24000,
**kwargs,
Expand All @@ -392,7 +392,7 @@ def __init__(
"sample_rate": sample_rate,
}
self.set_model_name(model)
self.set_voice(voice_id)
self.set_voice(voice)

self._client = AsyncOpenAI(api_key=api_key)

Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/playht.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class PlayHTTTSService(TTSService):
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)

Expand All @@ -49,7 +49,7 @@ def __init__(
"format": Format.FORMAT_WAV,
"voice_engine": "PlayHT2.0-turbo",
}
self.set_voice(voice_id)
self.set_voice(voice_url)
self._options = TTSOptions(
voice=self._voice_id,
sample_rate=self._settings["sample_rate"],
Expand Down

0 comments on commit 3d642df

Please sign in to comment.