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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| speech_analyser-0.8.0.tar.gz | 272.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| speech_analyser-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 295.3 kB
Release files / speech_analyser-0.8.0.tar.gz
| Download URL | speech_analyser-0.8.0.tar.gz |
|---|---|
| Size | 272.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b157e3400ca05d884eb871a53170182ecefa38a77301299fc5393e1969004d5
|
|
BLAKE2b-256 checksum How to use checksums |
4e1a8e0c8194e4538117a274a32aba0669b0855e3cc6b52ff9dfa2c690d2b7fc
|
| 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.0-py3-none-any.whl
| Download URL | speech_analyser-0.8.0-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b360ef43fd200764748dcb899d2b2d141ef8dddba43710fc9565910ac74b454
|
|
BLAKE2b-256 checksum How to use checksums |
aa4fece697e2c1515b8552de70c268d489a6671bb75b838b094e1e79bf3df0b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|