Skip to content

feat(audio): add voice note transcription and Islamic audio analysis #140 - #371

Open
Wiseman52 wants to merge 1 commit into
Deen-Bridge:devfrom
Wiseman52:feat/issue-140-voice-note-transcription
Open

feat(audio): add voice note transcription and Islamic audio analysis #140#371
Wiseman52 wants to merge 1 commit into
Deen-Bridge:devfrom
Wiseman52:feat/issue-140-voice-note-transcription

Conversation

@Wiseman52

@Wiseman52 Wiseman52 commented Aug 28, 2026

Copy link
Copy Markdown

Overview

This PR adds an offline-first Voice Note Transcription and Islamic Audio Analysis system: upload validation and noise assessment, a deterministic Islamic-audio analysis pipeline over transcribed speech (language/dialect identification, recitation detection, question extraction, terminology recognition, speaker estimate, timeline, tone), and pluggable Gemini/Whisper transcription backends with a responder seam for grounded answer drafting.

Related Issue

Closes #140

Changes

🎙️ Voice-Note Transcription & Islamic Audio Analysis

  • [ADD] audio_analysis.py
    • Magic-byte upload validation (WAV/OGG/MP3/M4A) with a 25 MiB cap, plus a WAV noise/SNR assessment that recommends denoising profiles.
    • Offline analysis pipeline: language & Arabic-dialect identification (Egyptian, Levantine, Gulf, Maghrebi vs MSA), Quranic recitation detection, timestamped question extraction, ~60-term Islamic-terminology recognition, a conservative speaker estimate, a timeline of key moments, and an emotional/spiritual tone read via the existing /sentiment engine.
    • Transcriber seam — Gemini (default via GEMINI_API_KEY), OpenAI-compatible Whisper (WHISPER_API_BASE), and offline Static/Passthrough — with streaming chunking for long clips, and a Responder seam for grounded answer drafting.
    • Endpoints: POST /audio/transcribe, POST /audio/analyze, POST /audio/generate, GET /audio/terminology, GET /audio/formats.
  • [MODIFY] main.py — register the audio-analysis router.
  • [MODIFY] README.md — document the feature, endpoints, and backend selection.
  • [ADD] tests/test_audio_analysis.py — 33 offline tests (no network, no keys).
  • [MODIFY] .github/workflows/ci.yml — add an audio-analysis test step.

Verification Results

ruff check .                                    ✅ All checks passed
ruff format --check .                           ✅ 187 files already formatted
mypy .                                          ✅ Success: no issues found in 187 source files
pytest -q tests/test_audio_analysis.py          ✅ 33 passed

Acceptance Criteria

Acceptance Criteria Status
Voice notes are transcribed into timestamped segments ✅ Gemini/Whisper backends plus offline Static/Passthrough fallbacks
Uploads are validated; oversize/mismatched rejected ✅ Magic-byte sniffing, 25 MiB cap, 415 on unrecognised formats
Transcripts analysed offline for Islamic audio context ✅ Language/dialect, recitation, questions, terminology, speakers, timeline, tone
Recognised terminology is browsable GET /audio/terminology (~60 terms)
CI covers the new module ✅ Dedicated pytest step; full lint/mypy/format suite green

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d4843df-8dcd-4096-a056-aedc5fa8f1bb


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Wiseman52 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@zeemscript

Copy link
Copy Markdown
Contributor

@Wiseman52 this PR has merge conflicts with the main branch. Please resolve the conflicts (merge main in or rebase) and push the fix so it can be merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants