diff --git a/examples/foundational/39-aws-nova-sonic.py b/examples/foundational/39-aws-nova-sonic.py index 567655002..445464957 100644 --- a/examples/foundational/39-aws-nova-sonic.py +++ b/examples/foundational/39-aws-nova-sonic.py @@ -66,6 +66,7 @@ async def run_bot(webrtc_connection: SmallWebRTCConnection): secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"), access_key_id=os.getenv("AWS_ACCESS_KEY_ID"), region=os.getenv("AWS_REGION"), + voice_id="tiffany", # matthew, tiffany, amy ) # Build the pipeline diff --git a/src/pipecat/services/aws_nova_sonic/aws.py b/src/pipecat/services/aws_nova_sonic/aws.py index 640658ca9..eb57d9b80 100644 --- a/src/pipecat/services/aws_nova_sonic/aws.py +++ b/src/pipecat/services/aws_nova_sonic/aws.py @@ -90,6 +90,7 @@ class AWSNovaSonicService(LLMService): access_key_id: str, region: str, model: str = "amazon.nova-sonic-v1:0", + voice_id: str = "matthew", # matthew, tiffany, amy **kwargs, ): super().__init__(**kwargs) @@ -99,6 +100,7 @@ class AWSNovaSonicService(LLMService): self._region = region self._model = model self._client: BedrockRuntimeClient = None + self._voice_id = voice_id self._stream: DuplexEventStream[ InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, @@ -257,7 +259,7 @@ class AWSNovaSonicService(LLMService): "sampleRateHertz": 24000, "sampleSizeBits": 16, "channelCount": 1, - "voiceId": "matthew", + "voiceId": "{self._voice_id}", "encoding": "base64", "audioType": "SPEECH" }}