Skip to main content

speech-analyser

Transcribes audio and video files and returns speech metrics: word count, speaking rate, filler word detection, silence ratio, and a quality score with natural-language insights. Optionally identifies individual speakers.

Part of the analyser family.

Install

pip install speech-analyser

Requires Python 3.11+. Uses CPU by default; GPU (CUDA) is used automatically if available.

For speaker diarization, install the extra and set a Hugging Face token:

pip install "speech-analyser[diarization]"
export HF_TOKEN=hf_...

Usage

Python

from speech_analyser import SpeechAnalyser

lens = SpeechAnalyser()             # model_size="base" by default
result = lens.analyse("recording.mp3")

m = result["speech_metrics"]
print(f"Duration:  {result['duration']:.1f}s")
print(f"Words:     {m['word_count']} ({m['speaking_rate_wpm']} wpm, {m['pace_category']})")
print(f"Quality:   {m['quality_score']}/100")
print(result["transcript"])

CLI

# Human-readable summary
speech-analyser recording.mp3

# Larger model for better accuracy
speech-analyser lecture.wav --model small

# Machine-readable JSON
speech-analyser recording.m4a --json

# Speaker diarization
speech-analyser interview.mp3 --diarize

# Video input, transcript file + SRT subtitles, timestamped lines
speech-analyser lecture.mp4 -o lecture.txt --srt --timestamps

# Force language, skip silence with the VAD filter
speech-analyser podcast.mp3 --language en --vad

# Start the HTTP server
speech-analyser serve --port 8001

File outputs (-o, --srt, --timestamps) were ported from a standalone transcribe.py script. -o writes the transcript to a text file; --srt writes SubRip subtitles next to the -o file (or next to the input); --timestamps prefixes each line with [HH:MM:SS.mmm]. Confirmations go to stderr, so --json output on stdout stays machine-readable.

HTTP API

curl -X POST http://localhost:8001/analyse \
  -F "file=@recording.mp3"

Supported formats

Audio: .mp3 .wav .m4a .ogg .flac .aac .wma .opus

Video: .mp4 .m4v .mov .avi .mkv .webm — the audio track is extracted to a temporary 16 kHz mono WAV with ffmpeg (must be on PATH; only needed for video inputs).

Model sizes

Model Speed Accuracy
tiny fastest lowest
base fast good (default)
small medium better
medium slow very good
large-v3 slowest best

Models download on first use (~75 MB for base, ~1.5 GB for large-v3).

Output

{
  "transcript": "Good morning everyone...",
  "language": "en",
  "duration": 62.4,
  "segments": [{"start": 0.0, "end": 3.2, "text": "Good morning everyone", "speaker": null}],
  "speech_metrics": {
    "word_count": 120,
    "speaking_rate_wpm": 115.4,
    "pace_category": "natural",
    "filler_word_count": 3,
    "filler_word_rate": 0.025,
    "filler_words_found": ["um", "basically"],
    "silence_ratio": 0.18,
    "actual_speaking_time": 51.2,
    "quality_score": 78,
    "quality_factors": {"clarity": 23, "depth": 18, "balance": 18, "pace": 19},
    "quality_ratings": {"clarity": "excellent", "depth": "good", "balance": "good", "pace": "good"},
    "insights": {
      "strengths": ["Very few filler words — speech is clear"],
      "observations": ["Speaking rate is slightly slow — aim for 130–170 wpm"]
    }
  },
  "diarization_available": false,
  "speakers": null,
  "talk_time": null,
  "file_path": "/path/to/recording.mp3",
  "file_size": 2048000
}

When diarization is enabled, speakers contains per-speaker word count, duration, and percentage; talk_time.is_balanced flags whether one speaker dominates.

The analyser family

Low-level analysis tools. Each accepts files directly and returns structured JSON. Build your own UI or pipeline on top.

Package Handles
speech-analyser audio and video files — transcript and speech metrics
video-analyser video files — frames, scenes, and visual quality
document-analyser PDF, DOCX, PPTX, TXT — text and readability
code-analyser source code — style, complexity, and quality metrics
records-analyser CSV, Excel, SQLite, Parquet, JSON — data profiling
auto-analyser any file — detects format and routes to the right tool

Licence

MIT

Metadata

Release files for speech-analyser 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speech-analyser 0.8.1
File Size Uploaded
speech_analyser-0.8.1.tar.gz 272.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for speech-analyser 0.8.1
File Interpreter ABI Platform
speech_analyser-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 296.9 kB

Release files / speech_analyser-0.8.1.tar.gz

Download URL speech_analyser-0.8.1.tar.gz
Size 272.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aa1b01bfd2e987490afc09d32e4b19bfeec46a14ce1adc169fcb70dd2cf775cb
BLAKE2b-256 checksum
How to use checksums
cfa0662337931fc71ac55cfa479f1bed787f72c4c75afdd8fccb1ef0a6a7c095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / speech_analyser-0.8.1-py3-none-any.whl

Download URL speech_analyser-0.8.1-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92a42858dc67db08abf45dfad15ca788cacf78e341fde0c7464631fb22382c32
BLAKE2b-256 checksum
How to use checksums
7d15d2d165f403b2abc496e45d8291377b96f7f29c4e30d17e89d31a2db22efc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page