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.
Android
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
private final String API_KEY = "84e**** **** **** **** 4823470a7876";
private final String SECRET_KEY = "GKHJ**** **** ****-8W57GXJ";
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:
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
mRtcEngine.setExtensionProperty(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, "API_KEY", API_KEY);
mRtcEngine.setExtensionProperty(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, "SECRET_KEY", SECRET_KEY); **
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:
mRtcEngine.enableExtension(ExtensionManager.EXTENSION_VENDOR_NAME, ExtensionManager.EXTENSION_AUDIO_FILTER_NAME, false); **
Step 10: Mainly 2 events in Marsview extension
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 failtransactionId
- is used to fetch transcribed data from marsviewSample code as follows:
@Override
public void onEvent(String vendor, String extension, String key, String value) {
Log.d(TAG, "\nVendor: " + vendor + "\nExtension:" + extension + "\nKey:" + key + "\nValue:" + value);
if (vendor == "Marsview" && extension == "TranscriptProvider") {
if (key == "transactionId") {
// Save transaction id for future purposes
} else if (key == "connectionState") {
try {
JSONObject reader = new JSONObject(value);
String connectionState = reader.getString("connection-state");
if (connectionState != "true") {
// provide proper api key, sercet key , user ID
}
} catch (Exception e) {}
}
}
}
Refer to https://docs.marsview.ai/speech-analytics-api/getting-metadata.
Support URL: https://docs.marsview.ai/contact-support.