Skip to main content

End-to-end audio pipeline: transcription + diarization + emotion enrichment

Project description

transcribe-diarize-emote

One-stop audio intelligence pipeline combining:

  • Transcription (faster-whisper)
  • Speaker Diarization (diarizer-lite)
  • Acoustic Emotion Context Enrichment (whisper-speaker-emotion)

Designed to produce LLM-ready conversational transcripts in a single pass.

What This Library Solves

Modern STT systems give you text.
But real conversation intelligence requires:

  • A clean transcription system
  • Who spoke → Diarization
  • How was it said → Acoustic emotion context
  • Clean speaker turns → LLM context engineering

transcribe-diarize-emote solves all three in one pipeline.

Why This Matters For LLM Workflows

Output can be directly used for:

  • Summarization
  • Sentiment Analysis
  • Topic Modeling
  • Call Quality Monitoring
  • Compliance Analytics
  • Customer Experience Intelligence
  • Conversation Mining
  • Agent Coaching
  • Risk / Escalation Detection

Key Features

  • Offline capable
  • No API keys required
  • CPU supported by default
  • CUDA GPU acceleration
  • Emotion layer optional toggle
  • Direct LLM-ready outputs

Installation

pip install transcribe-diarize-emote

Core Usage

from transcribe_diarize_emote import Pipeline

pipe = Pipeline(
    emotion=True,
    whisper_model="large-v3",
    device="cpu",
    compute_type="int8"
)

result = pipe.process("call.wav")

print(result.vtt)

Pipeline Configuration Explained

Emotion Layer (emotion)

Setting Meaning
emotion=True Adds acoustic emotion metrics
emotion=False Faster pipeline, text only

Whisper Model (whisper_model)

Recommended

  • large-v3

Other Supported Models

  • tiny
  • base
  • small
  • medium
  • large-v2
  • large-v3 (recommended for quality)

Device Support (device)

Device Supported
CPU Yes
CUDA GPU Yes
Apple MPS No

Compute Type (compute_type)

Device Recommended
CPU int8
CUDA float16

Audio Format

The major supported audio formats are:

  • .mp3
  • .wav

Output Behavior

emotion=False (Default)

Recommended Outputs

  • result.text
  • result.json
  • result.vtt

Sample Json

[
  {
    "start": 0.0,
    "end": 4.0,
    "speaker": "Speaker0",
    "text": "Hi, I wanted to report an issue with my ride this morning."
  },
  {
    "start": 4.0,
    "end": 7.0,
    "speaker": "Speaker1",
    "text": "Sure, could you tell me what happened?"
  },
  {
    "start": 7.0,
    "end": 13.0,
    "speaker": "Speaker0",
    "text": "Yeah, driver was polite but car wasn't clean and smelled weird."
  },
  {
    "start": 13.0,
    "end": 17.0,
    "speaker": "Speaker1",
    "text": "I'm sorry to hear that. Anything else?"
  },
  {
    "start": 17.0,
    "end": 25.0,
    "speaker": "Speaker0",
    "text": "Also he took a longer route even after I gave the correct address. Got it. We will look into this and report back."
  }
]

emotion=True

Recommended Output

  • result.vtt (Better for readability and LLM understanding)

Sample vtt

WEBVTT

Average Pitch:
Speaker0: 230.45 Hz
Speaker1: 190.78 Hz

Average RMS:
Speaker0: 0.068
Speaker1: 0.061

00:00:00.000 --> 00:00:04.000
<v Speaker0> Hi, I just wanted to give some feedback about my cab ride this morning.
Pitch: 236.22 Hz | RMS: 0.066
Pitch Difference with Average: +5.77 Hz
RMS Difference with Average: -0.002

00:00:04.000 --> 00:00:07.000
<v Speaker1> Sure, I can help you with that. Could you tell me what happened?
Pitch: 192.45 Hz | RMS: 0.062
Pitch Difference with Average: +1.67 Hz
RMS Difference with Average: +0.001

Output Philosophy

emotion=False

Structured conversational transcript optimized for:

  • Summarization
  • Classification
  • Topic modeling
  • Search indexing

emotion=True

Emotion-enriched transcript including (Additional context for LLM for sentiment analysis):

  • Speaker baseline voice metrics
  • Pitch (F0)
  • Loudness (RMS)
  • Emotional deviation from baseline tone

Citations

This library builds on the following open-source technologies:

- faster-whisper

High-performance Whisper inference powered by **CTranslate2**, enabling fast CPU and GPU transcription without requiring PyTorch runtime.
Project: https://pypi.org/project/faster-whisper/

- diarizer-lite

Lightweight stereo energy-based speaker diarization designed for offline processing and post-STT conversational structuring.
Project: https://pypi.org/project/diarizer-lite/

- whisper-speaker-emotion

Emotion-aware speaker analysis using audio pitch and loudness aligned with Whisper diarized VTT transcripts.
Project: https://pypi.org/project/whisper-speaker-emotion/

Designed For LLM Context Engineering

Traditional LLM pipelines rely purely on text transcripts.

However, real-world conversations contain acoustic emotional signals that text alone cannot capture.

Instead of forcing LLMs to infer emotion from text,
transcribe-diarize-emote provides measured acoustic context directly from audio.

This enables LLM systems to:

  • Detect emotional spikes
  • Improve sentiment confidence scoring
  • Identify escalation or frustration moments
  • Improve summarization quality
  • Improve explainability of sentiment and classification outputs

This is an example of context engineering — improving LLM outputs by improving the quality and richness of input context rather than modifying or tuning the model itself.

Contributing

Pull requests are welcome.

For major changes, please open an issue first to discuss what you would like to change.

Please ensure tests and documentation are updated where applicable.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transcribe_diarize_emote-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transcribe_diarize_emote-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file transcribe_diarize_emote-0.1.1.tar.gz.

File metadata

  • Download URL: transcribe_diarize_emote-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for transcribe_diarize_emote-0.1.1.tar.gz
Algorithm Hash digest
SHA256 723929d2464a89304efb130a158e4fb228ac214c92e64667a23a5a1f33e1dbfd
MD5 fa6ebd4e9f4535022707113640b1bedf
BLAKE2b-256 6ed1cd0546524077277de520d803def4d4bab38702f36ec930e4bb88b339b574

See more details on using hashes here.

File details

Details for the file transcribe_diarize_emote-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for transcribe_diarize_emote-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d2c883beed925f95cf47399b01d4c178ddea2ec5245c2504710f45487b0580e
MD5 b96a382f6b0d6d55c8017a93d397d16e
BLAKE2b-256 963af78c96678fd7cef3ad856110455cdcc4b9c04dab921f6aa7fac54503084c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page