Skip to content

Repository files navigation

Audio Transcribe

Real-time speech transcription with AI-powered Bible verse detection, built on ASP.NET Core and Azure AI.


Overview

Audio Transcribe streams audio from client applications (e.g., a Flutter mobile app) over a SignalR WebSocket connection, transcribes it in real-time with speaker diarization, and leverages the Microsoft Agent Framework (MAF)Microsoft.Agents.AI — to build AI agents that automatically detect Bible passages during live sermons and study sessions. The detection works in two ways: by recognizing explicit scripture references (e.g. "John 3:16") and by matching spoken phrases against the full text of the Bible, so verses are caught even when a speaker doesn't explicitly cite them. It also provides an AI-powered meeting summarization endpoint.

Features

  • Real-time streaming transcription — Continuous speech-to-text using Azure Cognitive Services Speech SDK
  • Speaker diarization — Identifies and labels multiple speakers in the audio stream
  • Automatic language detection — Supports en-US, en-NG, and en-GB
  • Bible verse detection — Built with Microsoft Agent Framework (Microsoft.Agents.AI), the agent uses two complementary strategies to detect Bible passages during live sermons or study sessions: reference-based detection when a speaker explicitly cites a verse (e.g. "John 3:16"), and phrase-based fuzzy matching when a speaker simply speaks the words of a passage without—or before—citing the reference. In both cases, the full verse text is fetched from the HelloAO Bible API and returned to the client in real time
  • Multi-translation support — 10 Bible translations: BSB (default), WEB, KJV, YLT, ASV, LSV, NETB, GNV, BBE, AAB
  • Session reconnection — Full event replay when a client reconnects after a network interruption
  • AI transcript summarization — Built with Microsoft Agent Framework (Microsoft.Agents.AI), the summarization agent produces Quill Delta-format summaries via POST /api/transcripts/summarize
  • Binary protocol — SignalR with MessagePack for efficient, low-overhead real-time communication

Architecture

 ┌──────────────┐    SignalR + MessagePack     ┌──────────────────────┐
 │              │ ◄────────────────────────── ► │                      │
 │  Flutter App  │    wss://host/transcription   │  AudioTranscribe     │
 │  (or any      │                               │  (ASP.NET Core 10)   │
 │   client)     │                               │                      │
 │              │                               │  ┌────────────────┐  │
 └──────────────┘                               │  │ Azure Speech   │  │
                                                │  │ SDK            │  │
                                                │  └───────┬────────┘  │
                                                │          │           │
                                                │  ┌───────▼────────┐  │
                                                │  │ Bible Detection│  │
                                                │  │ Agent (MAF)    │──┼──► Azure OpenAI
                                                │  └───────┬────────┘  │
                                                │          │           │
                                                │  ┌───────▼────────┐  │
                                                │  │ HelloAO Bible  │──┼──► HelloAO API
                                                │  │ Client         │  │
                                                │  └────────────────┘  │
                                                │                      │
                                                │  ┌────────────────┐  │
                                                │  │ Summary Agent  │──┼──► Azure OpenAI
                                                │  │ (MAF)          │  │
                                                │  └────────────────┘  │
                                                └──────────────────────┘

Tech Stack

Category Technology
Runtime .NET 10
Framework ASP.NET Core Minimal API
Real-time Comms SignalR + MessagePack
Speech-to-Text Azure Cognitive Services Speech SDK
AI Agents (MAF) Microsoft Agent Framework — Microsoft.Agents.AI.OpenAI
AI / LLM Azure OpenAI (Azure.AI.OpenAI)
Bible API HelloAO Bible API
Caching IMemoryCache (in-memory)
Concurrency ConcurrentDictionary

Getting Started

Prerequisites

  • .NET 10 SDK
  • Azure Speech Services subscription (Speech Key + Endpoint)
  • Azure OpenAI deployment (for Bible detection and summarization)

Configuration

Configuration uses the SpeechAIOptions section. Set via appsettings.json, User Secrets, or environment variables.

Option A — User Secrets (development):

dotnet user-secrets set "SpeechAIOptions:SpeechKey" "your-key"
dotnet user-secrets set "SpeechAIOptions:SpeechEndpoint" "https://your-region.api.cognitive.microsoft.com/sts/v1.0/issuetoken"
dotnet user-secrets set "SpeechAIOptions:AzureOpenAIEndpoint" "https://your-resource.openai.azure.com"
dotnet user-secrets set "SpeechAIOptions:AzureOpenAIApiKey" "your-openai-key"
dotnet user-secrets set "SpeechAIOptions:AzureOpenAIDeployment" "gpt-5.6-luna"
dotnet user-secrets set "SpeechAIOptions:DefaultBibleTranslation" "BSB"

Option B — Environment variables (production):

Variable Description
AzureSpeechKey Azure Speech Services key
AzureSpeechEndpoint Azure Speech endpoint URL
AZURE_OPENAI_ENDPOINT Azure OpenAI endpoint
AZURE_OPENAI_API_KEY Azure OpenAI API key
AZURE_OPENAI_DEPLOYMENT_NAME OpenAI deployment name

Running

# Restore dependencies
dotnet restore

# Run (development)
dotnet run

# Publish (production)
dotnet publish -c Release -o ./publish
dotnet ./publish/AudioTranscribe.dll

The server starts on https://localhost:7226 and http://localhost:5131.

API Reference

REST Endpoints

Method Route Description
GET / Health check
POST /api/transcripts/summarize Summarize a transcript (returns Quill Delta)

POST /api/transcripts/summarize

Request:

{
  "transcript": "Alice: I think we should...\nBob: I agree..."
}

Response: A Quill Delta JSON object with an ops array suitable for rich-text rendering.

SignalR Hub — /transcription

The hub uses MessagePack binary protocol. Clients must configure their SignalR connection with the MessagePack hub protocol.

Server → Client

Method Payload
OnTranscriptionEvent Event object (see below)

Client → Server

Method Parameters
StartSession sessionId: string, bibleTranslation?: string
SendAudioChunk sessionId: string, base64Chunk: string
StopSession sessionId: string

Audio format: 16-bit PCM, 16 kHz, mono, Base64-encoded.

Event Types

Event Discriminator Key Fields
TranscribingEvent "Transcribing" text — partial/interim result
TranscriptTextEvent "TranscriptText" text, isFinal
VerseDetectedEvent "VerseDetected" reference, translation, contextText
HubConnectionStateEvent "HubConnectionState" isConnected, isReconnecting

Client Integration

Audio Transcribe is designed to work with a Flutter client using signalr_netcore with MessagePack. A full implementation guide is included: flutter_implementation_guide.md.

Recommended Flutter client packages:

  • signalr_netcore — SignalR client with MessagePack support
  • record — Audio recording (PCM 16-bit, 16 kHz, mono)
  • provider — State management

Project Structure

AudioTranscribe/
├── Program.cs                          # Entry point, route registration
├── AudioTranscribe.csproj              # .NET 10 project file
├── flutter_implementation_guide.md     # Flutter client integration guide
├── Hubs/
│   └── Transcription/
│       ├── TranscriptionHub.cs         # SignalR hub
│       └── ITranscriptionClient.cs     # Typed hub client interface
├── Services/
│   └── Transcription/
│       ├── AzureSpeechDiarizationService.cs  # Core transcription orchestrator
│       ├── BibleDetectionAgent.cs            # MAF agent for verse detection
│       ├── TranscriptSummaryAgent.cs         # MAF agent for summarization
│       ├── HelloAoBibleClient.cs             # HelloAO Bible API client
│       ├── AudioDurationStore.cs             # Session audio time tracking
│       └── Model/                            # MessagePack event models
└── Shared/
    └── Time/
        ├── IClock.cs                   # Clock abstraction
        └── UtcClock.cs                 # UTC clock implementation

License

This project is provided as-is. See the repository license for terms.

About

Real-time speech transcription with AI-powered Bible verse detection, built on ASP.NET Core and Azure AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages