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.9.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 | Provenance | Actions |
|---|---|---|---|---|
| speech_analyser-0.9.0.tar.gz | 274.1 kB | Without provenance | Details for speech_analyser-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| speech_analyser-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for speech_analyser-0.9.0-py3-none-any.whl |
Total release size: 299.1 kB
Release files / speech_analyser-0.9.0.tar.gz
| Download URL | speech_analyser-0.9.0.tar.gz |
|---|---|
| Size | 274.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99bfed35edeab046b23e0481d60fccc0cc2700edb089cadf109ec186f12777de
|
|
BLAKE2b-256 checksum How to use checksums |
c41b5eaa04db06b2df9b03f9112416ef5e774dd4e5e111a2092765646244f54c
|
| 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.9.0-py3-none-any.whl
| Download URL | speech_analyser-0.9.0-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47934a249914ec1be976ee5392aa5b4c17c72b0b7df7bbc5515d391cfab61a9f
|
|
BLAKE2b-256 checksum How to use checksums |
eb9264d029a92e5a8d0706d791b6bb8a13ac14099cc0db8a80f4331b11dafeef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for speech-analyser 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.