[WIP] AWS Nova Sonic service - add voice_id
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user