Skip to content

Commit 321dff1

Browse files
authored
Create call-transcription-web.md
1 parent 9de324f commit 321dff1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
author: tomaschladek
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 08/08/2024
6+
ms.author: tchladek
7+
---
8+
9+
## Call transcription
10+
11+
`Transcription` is an extended feature of the class `Call`. You first need to obtain the transcription feature API object
12+
13+
```js
14+
const callTranscriptionApi = call.api(Features.Transcription);
15+
```
16+
17+
You can check state of the transcription in the property `isTranscriptionActive`. If value is set to `true`, then transcription is active.
18+
19+
```js
20+
const isTranscriptionActive = callTranscriptionApi.isTranscriptionActive;
21+
```
22+
23+
You can subscribe to event, that is triggered when state of transcription changes:
24+
25+
```js
26+
const isTranscriptionActiveChangedHandler = () => {
27+
console.log(callTranscriptionApi.isTranscriptionActive);
28+
};
29+
callRecordingApi.on('isTranscriptionActiveChanged', isTranscriptionActiveChangedHandler);
30+
```
31+
32+
You can unsubscribe from the event with the following code:
33+
34+
```js
35+
callRecordingApi.off('isTranscriptionActiveChanged', isTranscriptionActiveChangedHandler);
36+
```

0 commit comments

Comments
 (0)