Oracle Cloud Infrastructure (OCI) Speech is an AI service that applies automatic speech recognition (ASR) technology to convert media files to readable text that is stored in JSON and SubRip text (SRT) format. You can create a transcription job with the object storage location of media files and Speech processes selected media files asynchronously to generate transcription to your bucket. Speech handles low-fidelity media recordings and transcribes challenging recordings like meetings or call centers calls.
You use Speech AI to run transcription for multiple files, spread out across many jobs simultaneously. It becomes hard to track the status of all the files and know when your transcription is ready to be used. A common request from customers is for a notification when the status of the transcription job changes. Recently, the Speech AI team enabled notifications using the OCI Events service.
In this blog post, we cover how you can be notified about a transcription job’s status using the OCI Events and Notification services, which can generate email notifications based on transcription job status. This event-driven approach allows you to respond to state changes in OCI in real time, removing the need to poll the transcription job status on a predefined schedule.
OCI Events enables you to create automation based on the state changes of resources, such as transcription job, Compute instance, and bucket, throughout your tenancy. Use Events to allow your development teams to automatically respond when a resource changes its state.
You might use Events in the following ways:
Call an OCI function to attach generated SRT into audio when the transcription job is completed.
Convert files of one format to another when files are uploaded to an OCI Object Storage bucket.
Send a notification to a DevOps team when a database backup completes.
You can only deliver events to certain OCI services with a rule. Use the following services in actions to create an Event Rule:
For more information on OCI Events, including the supported services and associated events, see the documentation.
Now that we’ve identified the three available options that are triggered by events, let’s dive into these options and identify where to use them.
OCI Notifications broadcasts messages to one or more consumers using a publish-and-subscribe message pattern. The service can notify downstream systems whenever an event is triggered, an alarm threshold is breached, or someone directly publishes a message to the service. The Notification service currently supports the following subscribers:
Function (OCI functions as a service (FaaS))
HTTPS (Custom URL)
OCI Functions is a managed, serverless and elastic FaaS offering powered by the open source Fn Project that sits on top of the OCI stack. You can use OCI Functions to deploy your code or application, without the administrative overhead of maintaining any infrastructure or operating system software. OCI Functions supports code written in a variety of languages, such as Java, Python, Node, Go, and Ruby. Applications deployed as functions can subsequently be triggered in response to events. For more information about the OCI Functions service, see the documentation.
For our example use case, you can write a function that responds to an event emitted by OCI Speech on completion or failure of transcription job. The completed event also triggers for partially successful jobs.
OCI Streaming provides a fully managed, scalable, and durable storage solution for ingesting continuous, high-volume streams of data. When configured as a destination for OCI Events, you can write messages, such as the creation of a file on Object Storage, to a topic for subsequent consumption. To find out more about the OCI Streaming service, see the documentation.
In this blog, I decided to document the first of these three approaches. To enable email notification for OCI Speech events, follow these steps.
Create an OCI notification topic. In the menu, navigate to Developer Services and under Application Integration, select Notifications. The only required input for topic creation is the topic name.
After the topic is created, navigate to the topic details page and create an email subscription. Enter your email to receive notifications.
After you create the subscription, it goes into a pending state, awaiting confirmation. To activate the notification subscription, check the email account you specified and open the verification email. Click the Confirm subscription verification link for this subscription.
A browser tab opens, confirming that you have subscribed your email account to the topic, Speech_Topic.
Your verification of the email changes the subscription status from “Pending” to “Active.” Switch back to Oracle Cloud Console window and verify the subscription status changed to “Active.” You might need to refresh your browser.
You’re now subscribed to a Notifications topic. Next, define an event with conditions that, when met, publishes messages to this Notifications topic. Let's define an event that triggers an email notification when the job status changes in OCI Speech.
From the main menu, select Observability & Management and then Rules.
Click Create Rule and fill out the following details:
Display name: Provide a name, such as the event type.
Description: Provide a description.
Rule condition: Event type
Service name: AI Services - Speech
Event type: Speech – CompletedTranscriptionJob, Speech-FailedTranscriptionJob
Action type: Notifications
Notifications compartment: Choose your compartment.
Topic: Choose the topic created earlier, Speech_Topic.
Click Create Rule.
You’ve successfully configured a notification and tied an event to it with a specific compartment. When a job status changes in OCI Speech, an email notification is sent to the email address specified.
Trigger the event. Now create a job from OCI Speech to trigger the notification email.
In main menu, navigate to Analytics & AI, AI Services, and then OCI Speech. Click Create job.
Fill in the basic job information details and click Next.
Choose one or more media files to generate transcription and click Submit.
Wait for the job to change state to “Succeeded.”
Check the email account you specified to verify that a notification email was sent. Go to the specified email account and verify that a notification of the job status has been sent.
In this blog, we explored using the OCI Notifications service to trigger an email when a Speech job’s state change. This event-driven approach allows other OCI services to react to events as they happen within OCI Speech. With this pattern, you no longer need to poll for job statuses using a predefined schedule. This feature can enable automation for you and provide tools to integrate OCI Speech seamlessly into your enterprise solutions.
We hope that this blog helps as you learn more about Oracle Cloud Infrastructure Speech.
For more information, see the following resources:
Ankit Tyagi is Principal Member of Technical Staff for Oracle and engineering Lead for OCI Speech. He has experience in product development, cloud and AI. In 2018, Ankit joined the Oracle Cloud Infrastructure AI team.