Skip to main content
useTranscription(params?) : Object useTranscription can also be used to set up optional callbacks for transcription events.

Parameters (optional)

An object with the following optional properties:
onTranscriptionError
Function
Callback for the "transcription-error" event.
onTranscriptionMessage
Function
Callback for the "transcription-message" event.
onTranscriptionStarted
Function
Callback for the "transcription-started" event.
onTranscriptionStopped
Function
Callback for the "transcription-stopped" event.
onTranscriptionAppData
Function
Deprecated 0.18.0 Callback for the "app-message" event from transcription. This parameter is deprecated; use onTranscriptionMessage instead.

Return value

An object with the following properties:
error
boolean
true in the event of a "transcription-error".
isTranscribing
boolean
Returns true after transcription has started.
language
string
Returns the language applied for the transcription. Please check Deepgram’s language docs for details.
model
string
Returns the model applied for transcription. Please check Deepgram’s model docs for more details.
profanity_filter
boolean
Returns true when profanity filter is enabled. Please check Deepgram’s profanity filter docs for more details.
redact
boolean | array
Returns the redaction applied for transcription. Please check Deepgram’s redaction docs for more details.
startedBy
string
Returns the session_id for the participant who initiated the transcription.
startTranscription
Function
See daily-js startTranscription().
stopTranscription
Function
See daily-js stopTranscription().
tier
string
This field is deprecated, use model instead.
transcriptions
Transcription[]
Array of Transcription object. See Transcription for more information.
transcriptionStartDate
Date
Timestamp for when the transcription started.
updatedBy
string
Returns the session_id for the participant who updated the transcription most recently.
{
  "error": false,
  "isTranscribing": true,
  "language": "en",
  "model": "nova-2-general",
  "profanity_filter": false,
  "redact": "false",
  "startedBy": "0e92c476-3d2f-4ddc-b814-9447cd7e3b90",
  "startTranscription": <Function>,
  "stopTranscription": <Function>,
  "transcriptions": <Object>,
  "transcriptionStartDate": "Mon Sept 05 2022 10:33:30 GMT+0200 (Central European Summer Time)",
  "updatedBy": "0e92c476-3d2f-4ddc-b814-9447cd7e3b90"
}

Example

import { useTranscription } from '@daily-co/daily-react';

export const useTranscriptionDemo = () => {
  const { isTranscribing } = useTranscription();

  return <div>{!isTranscribing ? 'Not' : ''} transcribing</div>;
};

See also