Skip to content

Commit

Permalink
[realtime-api-plus] fix avatar failure (#2698)
Browse files Browse the repository at this point in the history
Co-authored-by: Yulin Li <[email protected]>
  • Loading branch information
yulin-li and Yulin Li authored Dec 11, 2024
1 parent e392c9c commit a1b5f8c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions samples/realtime-api-plus/realtime-api-plus/azure_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ def configure(self, voice: str):
endpoint_prefix = "voice"

self.voice = voice
endpoint = f"wss://{SPEECH_REGION}.{endpoint_prefix}.speech.microsoft.com/cognitiveservices/websocket/v1?trafficType=RealtimePlus&enableTalkingAvatar=true"

if SPEECH_KEY:
self.speech_config = speechsdk.SpeechConfig(subscription=SPEECH_KEY, region=SPEECH_REGION)
self.speech_config = speechsdk.SpeechConfig(subscription=SPEECH_KEY, endpoint=endpoint)
else:
auth_token = f"aad#{SPEECH_RESOURCE_ID}#{token_provider()}"
self.speech_config = speechsdk.SpeechConfig(
endpoint=f"wss://{SPEECH_REGION}.{endpoint_prefix}.speech.microsoft.com/cognitiveservices/websocket/v1?debug=3&trafficType=AzureSpeechRealtime&enableTalkingAvatar=true"
)
self.speech_config = speechsdk.SpeechConfig(endpoint=endpoint)
self.speech_config.speech_synthesis_voice_name = voice
self.speech_config.endpoint_id = endpoint_id
self.speech_config.set_speech_synthesis_output_format(
Expand Down

0 comments on commit a1b5f8c

Please sign in to comment.