OCI Speech AI: Audio Transcription, Arabic Support, and Custom Vocabulary

OCI Speech converts audio to text using deep learning models trained on large speech corpora. It supports batch transcription of pre-recorded audio files from Object Storage and real-time streaming transcription over WebSocket for live audio. Arabic and English are supported with models tuned for Gulf Arabic dialect. Speaker diarization identifies and labels different speakers in a conversation. This post covers Terraform setup, batch transcription configuration, and event-driven post-processing.

Step 1: IAM Policy and Buckets

resource "oci_identity_policy" "speech_policy" {
  compartment_id = var.compartment_id
  name           = "oci-speech-policy"
  statements = [
    "Allow group AIEngineers to manage ai-service-speech-family in compartment id COMPARTMENT_OCID",
    "Allow service aispeech to read object-family in compartment id COMPARTMENT_OCID",
    "Allow service aispeech to manage objects in compartment id COMPARTMENT_OCID where target.bucket.name = 'speech-transcription-output'"
  ]
}

resource "oci_objectstorage_bucket" "audio_input" {
  compartment_id = var.compartment_id
  namespace      = var.tenancy_namespace
  name           = "speech-audio-input"
  access_type    = "NoPublicAccess"
}

resource "oci_objectstorage_bucket" "transcription_output" {
  compartment_id = var.compartment_id
  namespace      = var.tenancy_namespace
  name           = "speech-transcription-output"
  access_type    = "NoPublicAccess"
}

Step 2: Batch Transcription Job

resource "oci_ai_speech_transcription_job" "call_center_batch" {
  compartment_id = var.compartment_id
  display_name   = "call-center-recordings-transcription"

  input_location {
    location_type = "OBJECT_LIST_INLINE_INPUT_LOCATION"
    object_locations {
      namespace_name = var.tenancy_namespace
      bucket_name    = oci_objectstorage_bucket.audio_input.name
      object_names   = ["recordings/2026-12-05/"]
    }
  }

  output_location {
    namespace_name = var.tenancy_namespace
    bucket_name    = oci_objectstorage_bucket.transcription_output.name
    prefix         = "transcripts/2026-12-05/"
  }

  model_details {
    language_code = "ar-AE"
    model_type    = "WHISPER_MEDIUM"
  }

  normalization {
    is_punctuation_enabled = true
    filters {
      type = "PROFANITY"
      mode = "MASK"
    }
  }

  additional_transcription_formats = ["SRT"]

  defined_tags = { "Operations.ManagedBy" = "terraform" }
}

output "transcription_job_id" { value = oci_ai_speech_transcription_job.call_center_batch.id }

Step 3: Event-Driven Post-Processing

resource "oci_events_rule" "transcription_complete" {
  compartment_id = var.compartment_id
  display_name   = "transcription-job-complete"
  is_enabled     = true

  condition = jsonencode({
    "eventType" = ["com.oraclecloud.aispeech.transcriptionjob.update"]
    "data"      = { "lifecycleState" = ["SUCCEEDED"] }
  })

  actions {
    actions {
      action_type = "FAAS"
      is_enabled  = true
      function_id = var.transcript_ingestion_function_id
      description = "Index completed transcript for search and analytics"
    }
  }
}

Operational Notes

Audio quality directly impacts transcription accuracy. OCI Speech performs best on audio with a sampling rate of 16 kHz or higher, low background noise, and clear pronunciation. For call center recordings captured at 8 kHz telephone quality, expect higher word error rates. Pre-process telephone audio with noise reduction before transcription to improve accuracy on lower-quality input.

The Whisper Medium model generally outperforms the default model for Arabic and accented speech at the cost of slightly higher processing time. For batch jobs where accuracy matters more than turnaround time, Whisper Medium is the right choice. For real-time streaming where latency is critical, use the faster default model and accept the slightly higher word error rate.

Regards,
Osama

#OCI #OracleCloud #SpeechAI #Transcription #AI #Terraform #IaC #TechBlog #Oracle #MachineLearning #NLP #AudioAI #Arabic #GulfArabic #CallCenter #SpeakerDiarization #BatchProcessing #EventDriven #OracleCloudInfrastructure #WhisperModel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.