Skip to main content
Voice transcription extension allows you to convert an audio message into text.

Before you begin

1

Create a Rev.ai account

Sign up with Rev.ai.
2

Generate an access token

Get your Rev.ai Access Token for configuring this extension.

Extension settings

1

Open your CometChat app

Login to CometChat and select your app.
2

Enable Voice Transcription

Go to Chat & Messaging —> Features, under Extentions and enable Voice Transcription.
3

Add your access token

Open the settings and enter the Rev.ai Access Token.
4

Save settings

Save your configuration to activate the extension.

Choose Your Integration Method

Choose the integration method that best suits your needs:

UI Kit Builder

  • Enable it in both Dashboard and UI Kit Builder settings, then you can use the TinyURL extension in your custom chat experience.

Widget Builder

  • Enable it in both Dashboard and Widget Builder settings, then you can use the TinyURL extension in your custom chat widget.

UI Kits

  • Enable it in the Dashboard settings, then you can use the TinyURL extension in your custom chat experience built with our UI Kits.

SDK

  • Enable it in the Dashboard settings, then you can use the TinyURL extension in your custom chat experience built with our SDK.

Code

Once the Extension is enabled for your App and the settings are done, the recipients will receive metadata with the transcription details.
The transcription information is updated after the message is sent, so implement the onMessageEdited listener. See Edit message in the SDK docs.
Here is a sample response:
"@injected": {
  "extensions": {
    "voice-transcription": {
      "transcribed_message": "This is a test"
  }
}
If the voice-transcription key is missing, it means that either the extension is not enabled or has timed out.

Implementation

At the recipients’ end, from the message object, you can fetch the metadata by calling the getMetadata() method. Using this metadata, you can fetch the Rich Media Embed.
var metadata = message.getMetadata();
if (metadata != null) {
  var injectedObject = metadata["@injected"];
  if (injectedObject != null && injectedObject.hasOwnProperty("extensions")) {
    var extensionsObject = injectedObject["extensions"];
    if (
      extensionsObject != null &&
      extensionsObject.hasOwnProperty("voice-transcription")
    ) {
      var voiceTranscriptionObject = extensionsObject["voice-transcription"];
      var transcribed_message = voiceTranscriptionObject["transcribed_message"];
    }
  }
}