@@ -16,10 +16,13 @@ Define the TranscriptionOptions for ACS to specify when to start the transcripti
16
16
17
17
``` python
18
18
transcription_options = TranscriptionOptions(
19
- transport_url = " " ,
19
+ transport_url = " WEBSOCKET_URI_HOST " ,
20
20
transport_type = TranscriptionTransportType.WEBSOCKET ,
21
21
locale = " en-US" ,
22
- start_transcription = False
22
+ start_transcription = False ,
23
+ # Only add the SpeechRecognitionModelEndpointId if you have a custom speech model you would like to use
24
+ SpeechRecognitionModelEndpointId = " YourCustomSpeechRecognitionModelEndpointId"
25
+ );
23
26
)
24
27
25
28
call_connection_properties = call_automation_client.create_call(
@@ -39,7 +42,9 @@ transcription_options = TranscriptionOptions(
39
42
transport_url = " " ,
40
43
transport_type = TranscriptionTransportType.WEBSOCKET ,
41
44
locale = " en-US" ,
42
- start_transcription = False
45
+ start_transcription = False ,
46
+ # Only add the SpeechRecognitionModelEndpointId if you have a custom speech model you would like to use
47
+ SpeechRecognitionModelEndpointId = " YourCustomSpeechRecognitionModelEndpointId"
43
48
)
44
49
45
50
connect_result = client.connect_call(
@@ -164,7 +169,14 @@ asyncio.get_event_loop().run_forever()
164
169
For situations where your application allows users to select their preferred language, you may also want to capture the transcription in that language. To do this task, the Call Automation SDK allows you to update the transcription locale.
165
170
166
171
``` python
167
- await call_connection_client.update_transcription(locale = " en-US-NancyNeural" )
172
+ await call_automation_client.get_call_connection(
173
+ call_connection_id = call_connection_id
174
+ ).update_transcription(
175
+ operation_context = " UpdateTranscriptionContext" ,
176
+ locale = " en-au" ,
177
+ # Only add the SpeechRecognitionModelEndpointId if you have a custom speech model you would like to use
178
+ SpeechRecognitionModelEndpointId = " YourCustomSpeechRecognitionModelEndpointId"
179
+ )
168
180
```
169
181
170
182
## Stop Transcription
0 commit comments