Releases: NavodPeiris/speechlib
Releases · NavodPeiris/speechlib
Release list
v2.0.2
speechlib 2.0.2
Version 2 introduces major revamp of the API along some improvements to package quality and speed.
Architecture
- New Pipeline class replaces legacy Transcriptor API — instance-based, no provider kwargs at call time
- Abstract base classes (BaseDiarizer, BaseRecognizer, BaseASR) with full docstrings — plug in any backend
- All provider-specific settings live on component instances (PyAnnoteDiarizer, FasterWhisperASR, etc.)
- All legacy files deleted (speechlib.py, core_analysis.py, transcribe.py, speaker_recognition.py, wav_segmenter.py, etc.)
Performance
- Single-pass diarization — full file always diarized in one pass, preserving global speaker context
- Parallel transcription via ThreadPoolExecutor — segments transcribed concurrently across workers threads (CTranslate2/PyTorch release the GIL, so threads give real concurrency)
- BytesIO virtual filesystem — audio clips extracted into in-memory buffers instead of temp files on disk; no disk I/O, no cleanup, inherently thread-safe
- workers defaults to cpu_count - 1; pass 1 for sequential
ASR Backends as classes
- FasterWhisperASR — faster-whisper (CTranslate2), int8 quantization option
- WhisperASR — OpenAI Whisper
- CustomWhisperASR — local fine-tuned .pt checkpoint
- HuggingFaceASR — any HF ASR model; explicit torch_dtype per device (float32 on CPU, float16 on CUDA) to fix LayerNorm half-precision error; integer device index to fix meta tensor error
- AssemblyAIASR — cloud API; writes single temp file only when given a buffer (unavoidable)
All backends accept str | BinaryIO in transcribe()
Pipeline customizability
- whole pipeline including diarize, ASR, speaker recognition stages are fully customizable
- use base classes BaseDiarizer, BaseRecognizer, BaseASR to implement your own solutions
Diarization
- PyAnnoteDiarizer — supports num_speakers (exact count) or min_speakers/max_speakers
Robustness
- Zero-duration and empty segments skipped before transcription (prevents reshape errors)
- Same guard in speaker recognition — empty clips skipped before SpeechBrain embedding extraction
Output
- output_format: "txt", "json", or "both"
- srt=True — writes SRT subtitle file alongside transcript
- Batch mode — pipeline.run([file1, file2, ...]) returns one result list per file
Build System is now Hatchling
- Hatchling provides a modern, fast, and PEP-compliant build system that replaces legacy setuptools with a fully declarative
pyproject.tomlapproach, resulting in quicker, more reproducible builds, a cleaner project structure, and simplified packaging without the need forsetup.py.
Contributors
v1.1.17
v1.1.16
- fixed dependency issues
- using uv instead of pip
v1.1.12
v1.1.11
- fixed numpy issues
- updated all dependencies to latest versions
- now using speechbrain 1.0 as Pyannote.audio 3.3.1 now supports it
v1.1.10
v1.1.5
added missing cuda support for custom and hf models
release v1.1.4
release v1.1.3
changelog:
- added support to load custom whisper models from local disk
- added support to use huggingface finetuned whisper models
release 1.1.2
- added fp16 support for running normal whisper on gpu
- updated readme