Skip to content

AI Bible Quotation App that listens live during sermons and displays Bible quotations in real time. the app streams voice to a server. The server transcribes the audio using OpenAI Whisper, streams the transcription to Google Gemini Flash to extract a Bible quote address , queries a Bible database , and returns it for display.

Notifications You must be signed in to change notification settings

s-kvng/Divine-Whispers

Repository files navigation

Divine Whispers

The AI Bible Quotation App is an innovative web application designed to listen to sermons in real-time, transcribe the spoken word, extract Bible references, and display the full Bible quotations. It leverages cutting-edge technologies such as Next.js (with the App Router), Groq (or OpenAI) for transcription, Google Generative AI for Bible reference extraction, Prisma with SQLite for Bible data storage, and Pusher for real-time updates.

Table of Contents

Overview

The AI Bible Quotation App listens during sermons and performs the following steps in real-time:

  1. Audio Capture: Uses the browser’s MediaRecorder API to capture audio.
  2. Transcription: Sends audio data to an API endpoint that transcribes it using Groq's (or OpenAI's) Whisper model.
  3. Reference Extraction: Utilizes Google Generative AI to extract Bible references (e.g., "John 3:16") from the transcription.
  4. Bible Quote Retrieval: Queries a local Bible database (populated from a KJV SQL file via Prisma) for the full quote.
  5. Real-Time Updates ⚗️ : Delivers the quote to the user interface in real-time using Pusher.

Features

  • Real-Time Audio Transcription(Not fully Implemented yet) ⚗️ : Capture audio continuously during sermons.
  • Bible Reference Extraction: Robust prompt engineering to extract explicit and implicit Bible references.
  • Local Bible Database: Query a fully integrated KJV Bible database using Prisma.
  • Real-Time Updates: Instantaneous delivery of quotes using Pusher.
  • Next.js Full-Stack Application: Seamless integration of frontend and backend using the latest Next.js App Router.

Architecture

The project is built using the following stack:

  • Next.js (App Router): For both frontend and backend (API routes).
  • Groq SDK : To transcribe audio using the Whisper model.
  • Google Generative AI: For extracting Bible references from transcription text.
  • Prisma + SQLite: To manage and query the KJV Bible database.
  • Pusher: For real-time updates from the server to the client.
  • MediaRecorder API: To capture live audio on the client side.

Installation

  1. Clone the Repository:

    git clone git@github.com:s-kvng/Divine-Whispers.git
    cd divine-whispers
  2. Install Dependencies

    pnpm install
  3. Database Setup

    dev.db (already in folder)
  4. Generate Prisma Client

    npx prisma generate
  5. Environment Setup

    rename env.example to .env.local & add variables

Usage

  1. Start the Development Server:

    pnpm dev or npm run dev
  2. Start the Development Server:

    Visit http://localhost:3000 in your browser.
  3. Demoing the app

    Note: For now you need to stop listening before the realtime event is fired. Working hard to improve the experience ⚗️ 

Folder Structure

ai-bible-quotation-app/
├── app/
│   ├── api/
│   │   └── v1/
│   │       ├── transcribe/
│   │       │   └── route.ts         # API route for audio transcription and Bible reference extraction
│   │       └── bible/
│   │           └── route.ts         # API route for fetching Bible quotes from the database
│   └── page.tsx                     # Main page using the custom hooks
├── hooks/
│   └── useBibleListening.ts         # Custom hook to manage recording and Pusher subscription
├── lib/
│   ├── prisma.ts                    # Prisma client instance
│   └── pusher.ts                    # Pusher client and server instances
├── prisma/
│   └── schema.prisma                # Prisma schema file
├── kjv_bible.sql                    # SQL file containing KJV Bible data
├── .env.example                       # Environment variables
├── package.json
└── README.md                        # This file

Contributions

Not all features are implemented yet, so contributions are welcome! Please fork the repository and create a pull request with your proposed changes. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License.

Acknowledgements

About

AI Bible Quotation App that listens live during sermons and displays Bible quotations in real time. the app streams voice to a server. The server transcribes the audio using OpenAI Whisper, streams the transcription to Google Gemini Flash to extract a Bible quote address , queries a Bible database , and returns it for display.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published