Skip to main content

Marsview

This guide is provided by Marsview. Agora is planning a documentation upgrade program for all extensions on the marketplace. Please stay tuned.

Marsview Speech Analytics is a cloud-hosted or containerized API service that helps you accurately transcribe a conversation and discover insights. It is packed with models for automatic speech recognition (ASR), Intent Recognition, Tone Analysis, Natural Language Classifiers to uncover topics, keywords, entities and sentiments.

Prerequisites

Android

Integrate Marsview Speech Analytics

Please follow the step by step process to implement Marsview Speech Analytics extension with your application

(We are providing code samples written in Java)

Step 1: Unzip file , you will get .ar file. keep it in your native project.

Step 2: Extension package agoramarketplace.marsview.extension

Step 3: You will get an api key and secret when you create a project with Marsview through Agora.

Step 4: You have to import agoramarketplace.marsview.extension.ExtensionManager;

Step 5: Add the credentials to your file


_3
private final String API_KEY = "84e**** **** **** **** 4823470a7876";
_3
private final String SECRET_KEY = "GKHJ**** **** ****-8W57GXJ";
_3
private final String USER_ID = "yourcustomerid@agora.io";

Step 6: Implement the interface io.agora.rtc2.IMediaExtensionObserver

After enabling RTCEngine you need to follow the next step:

Step 7: Now you need to pass these variables to enable the extension

Before starting your RTC Streaming you need to enable this:


_1
mRtcEngine.enableExtension(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, true);

Step 8: For authentication purpose, we need to pass API credentials to the extension


_3
mRtcEngine.setExtensionProperty(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, "API_KEY", API_KEY);
_3
mRtcEngine.setExtensionProperty(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, "SECRET_KEY", SECRET_KEY); **
_3
mRtcEngine.setExtensionProperty(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, "USER_ID", USER_ID); **

Step 9: When you want to disable the transcription service, you need to set the following:


_1
mRtcEngine.enableExtension(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, false); **

Step 10: Mainly 2 events in Marsview extension

  1. connectionState - this event describes the authentication status of the user. when the credentials do not match with the credentials he has received from agora for the extension the connection will fail

  2. transactionId - is used to fetch transcribed data from marsview

Run the demo

Sample code as follows:


_17
@Override
_17
public void onEvent(String vendor, String extension, String key, String value) {
_17
Log.d(TAG, "\nVendor: " + vendor + "\nExtension:" + extension + "\nKey:" + key + "\nValue:" + value);
_17
if (vendor == "Marsview" && extension == "TranscriptProvider") {
_17
if (key == "transactionId") {
_17
// Save transaction id for future purposes
_17
} else if (key == "connectionState") {
_17
try {
_17
JSONObject reader = new JSONObject(value);
_17
String connectionState = reader.getString("connection-state");
_17
if (connectionState != "true") {
_17
// provide proper api key, sercet key , user ID
_17
}
_17
} catch (Exception e) {}
_17
}
_17
}
_17
}

Reference

Refer to https://docs.marsview.ai/speech-analytics-api/getting-metadata.

Support URL: https://docs.marsview.ai/contact-support.

Page Content