Post Transcription & Summary - Android
This guide will walk you through the necessary steps to enable post-transcription functionality in your application, allowing users to access transcriptions of recorded meetings.
Moreover, VideoSDK offers flexibility in configuring post-time transcription, allowing you to set up webhooks for this purpose.
Integrating Post Transcription Feature
In the image above, the recording begins with transcription and summary features turned on. This triggers a webhook call for the start of recording. When the recording stops, another webhook is activated. After the recording, our transcriber starts transcribing, which in turn activates a webhook. Once the transcription is finished, it's sent to the summarizer for summary generation, and then another webhook is triggered.
Step 1: Configure Post Transcription & Summary
- In this step, we set up the configuration for post transcription and summary generation. We define the webhook URL where the webhooks will be received.
- Kotlin
- Java
// Webhook URL where, webhooks are received
val webhookUrl = "https://www.example.com"
// Post Transcription Configuration
val prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
val summaryConfig = SummaryConfig(true, prompt)
val modelId = "raman_v1"
val transcription = PostTranscriptionConfig(true, summaryConfig, modelId)
// Webhook URL where, webhooks are received
final String webhookUrl = "https://www.example.com";
// Post Transcription Configuration
String prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary";
SummaryConfig summaryConfig = new SummaryConfig(true, prompt);
String modelId = "raman_v1";
PostTranscriptionConfig transcription = new PostTranscriptionConfig(true, summaryConfig, modelId);
Step 2: Start Recording with Transcription Configuration
- Once the configuration is set, we initiate the recording process for the meeting, incorporating the transcription configuration we defined earlier.
- Kotlin
- Java
// Start Recording
meeting!!.startRecording(webhookUrl, "AWS Directory Path", null, transcription)
// Start Recording
meeting.startRecording(webhookUrl, "AWS Directory Path", null, transcription);
Step 3: Stop Recording
- When the meeting concludes or recording is no longer needed, we stop the recording process.
- Kotlin
- Java
// Stop Recording
meeting!!.stopRecording()
// Stop Recording
meeting.stopRecording();
Step 4: Fetch Post Transcriptions
-
After the meeting recording is stopped, post transcription and summary data can be obtained using the Post Transcription API.
-
The API provides information such as the status of transcription, file paths for transcription data in various formats (JSON, SRT, TXT, TSV, VTT), and a summarized text file.
-
The transcription document is structured as follows:
{
"id": "40b0a4ed-9842-40c9-a288-e4b1bf98a90a",
"status": "completed",
"roomId": "abc-xyzw-lmno",
"sessionId": "621497578bea0d0404c35c4c",
"recordingId": "65d303d6d2c373dfd71b38a2",
"filePath": "https://cdn.videosdk.live/encoded/videos/dummy.mp4",
"transcriptionFilePaths": {
"json": "https://cdn.videosdk.live/transcriptions/dummy/dummy.json",
"srt": "https://cdn.videosdk.live/transcriptions/dummy/dummy.srt",
"txt": "https://cdn.videosdk.live/transcriptions/dummy/dummy.txt",
"tsv": "https://cdn.videosdk.live/transcriptions/dummy/dummy.tsv",
"vtt": "https://cdn.videosdk.live/transcriptions/dummy/dummy.vtt"
},
"summarizedFilePaths": {
"txt": "https://cdn.videosdk.live/transcriptions/dummy/dummy-summary.txt"
},
"userStorage": null,
"start": "2024-02-27T16:00:36.828Z",
"end": "2024-02-27T16:01:46.939Z"
}
Example
- The following code snippet allows you to start and stop recording meetings with just a click. When you click the "Start Recording" button, it begins recording the meeting and enables post-transcription, which generates a summary of the meeting's content. Clicking the "Stop Recording" button ends the recording.
- Kotlin
- Java
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
class MeetingActivity : AppCompatActivity() {
private lateinit var meeting: Meeting
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_meeting)
//initialize a meeting
//...
val startButton = findViewById<Button>(R.id.startRecording)
val stopButton = findViewById<Button>(R.id.stopRecording)
startButton.setOnClickListener {
// Configuration for post transcription
val prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
val summaryConfig = SummaryConfig(true, prompt)
val modelId = "raman_v1"
val transcription = PostTranscriptionConfig(true, summaryConfig, modelId)
// If you don't have a `webhookUrl` or `awsDirPath`, you have to pass null.
// Start recording with post transcription
meeting.startRecording("YOUR WEB HOOK URL", "AWS Directory Path", null, transcription)
}
stopButton.setOnClickListener {
// Stop recording
meeting.stopRecording()
}
}
}
import android.os.Bundle;
import android.widget.Button;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MeetingActivity extends AppCompatActivity {
private Meeting meeting;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_meeting);
//initialize a meeting
//...
Button startButton = findViewById(R.id.startRecording);
Button stopButton = findViewById(R.id.stopRecording);
startButton.setOnClickListener(v -> {
// Configuration for post transcription
String prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary";
SummaryConfig summaryConfig = new SummaryConfig(true, prompt);
String modelId = "raman_v1";
PostTranscriptionConfig transcription = new PostTranscriptionConfig(true, summaryConfig, modelId);
// If you don't have a `webhookUrl` or `awsDirPath`, you have to pass null.
// Start recording with post transcription
meeting.startRecording("YOUR WEB HOOK URL", "AWS Directory Path", null, transcription);
});
stopButton.setOnClickListener(v -> {
// Stop recording
meeting.stopRecording();
});
}
}
Please be aware that there may be a delay in processing the transcription data after the recording has been stopped. This delay could vary depending on factors such as server load and the duration of the meeting.
API Reference
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord