Skip to content

Commit 94f2c76

Browse files
authored
Update real-time-transcription-python.md
add custom speech id
1 parent c310695 commit 94f2c76

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

articles/communication-services/how-tos/call-automation/includes/real-time-transcription-python.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ Define the TranscriptionOptions for ACS to specify when to start the transcripti
1616

1717
```python
1818
transcription_options = TranscriptionOptions(
19-
transport_url=" ",
19+
transport_url="WEBSOCKET_URI_HOST",
2020
transport_type=TranscriptionTransportType.WEBSOCKET,
2121
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+
);
2326
)
2427

2528
call_connection_properties = call_automation_client.create_call(
@@ -39,7 +42,9 @@ transcription_options = TranscriptionOptions(
3942
transport_url="",
4043
transport_type=TranscriptionTransportType.WEBSOCKET,
4144
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"
4348
)
4449

4550
connect_result = client.connect_call(
@@ -164,7 +169,14 @@ asyncio.get_event_loop().run_forever()
164169
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.
165170

166171
```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+
)
168180
```
169181

170182
## Stop Transcription

0 commit comments

Comments
 (0)