startTranscription()
startTranscription({ language, model })
You can start the service by calling startTranscription() on your call object.
Optionally pass configuration options:
| Name | Type | Description | Default value |
|---|---|---|---|
language | string | See Deepgram's documentation for language | 'en' |
model | string | See Deepgram's documentation for model | 'general' |
tier | string | See Deepgram's documentation for tier | 'base' |
profanity_filter | boolean | See Deepgram's documentation for profanity_filter | false |
redact | boolean | See Deepgram's documentation for redact | false |
Transcription message data is passed from the transcription service to the Daily call object via the "app-message" event. These transcription "app-message" events will have a fromId of "transcription".
By listening to "app-message" events emitted from the transcription service, text can be received and handled by your application. It's helpful to also listen for the is_final attribute to receive only completed sentences instead of sentence fragments.
The properties that the data of a transcription "app-message" contains are as follows:
| Property | Type | Description |
|---|---|---|
is_final | boolean | Whether the event contains a completed sentence or a sentence fragment |
session_id | string | The session ID of the participant being transcribed |
text | string | The contents of the transcription |
timestamp | string | Timestamp of transcription generation |
user_id | string | The user ID of the participant being transcribed |
Below is an example of listening and logging transcription messages in the browser console:
It has no effect if transcription is not enabled.