Skip to main content

TingXie

Convert audio recordings to text using faster-whisper with ModelScope model downloads. No HuggingFace needed — models are fetched from ModelScope's China-based CDN.

What It Does

TingXie transcribes .wav, .mp3, .m4a, .flac, .ogg, .wma, .aac, .opus, and .webm files to text. It can process a single file or batch-transcribe an entire directory. Each file gets detected language, per-segment timestamps, and a plain-text transcript.

Models download automatically from ModelScope (iic/speech_whisper_* repos), not HuggingFace. Set TINGXIE_MODEL_DIR to override the cache directory (default: ~/.cache/tingxie/models).

What it does not do: streaming transcription, real-time microphone input, speaker diarization, or translation (transcription only).

Features

  • Single file or batch directory transcription
  • faster-whisper: 4x faster than openai-whisper, lower memory usage
  • ModelScope model downloads (no HuggingFace, no wall issues in China)
  • 15+ Whisper model variants: tiny, base, small, medium, large-v3, turbo, distil-*
  • CPU and CUDA inference with configurable compute type
  • Automatic language detection or manual language hint
  • Per-segment timestamps with verbose mode
  • JSON output for pipeline integration
  • OpenAI function-calling tools schema for agent integration

Requirements

  • Python >= 3.9
  • faster-whisper (installed automatically)
  • modelscope (installed automatically)
  • CTranslate2 (installed with faster-whisper)
  • FFmpeg (required by faster-whisper — brew install ffmpeg on macOS)

Installation

pip install -e .

For development dependencies:

pip install -e ".[dev]"

Quick Start

Transcribe a single file:

tingxie samples/20260610_125906.wav

Batch transcribe a directory:

tingxie samples/ -m base -l zh

Save transcripts to files:

tingxie samples/ -o output/

Force CPU inference:

tingxie recording.wav --device cpu

CLI Usage

tingxie [-V] [-v] [-q] [--json] [-m MODEL] [-l LANG] [-o PATH]
        [--device {auto,cpu,cuda}] [--compute-type TYPE] PATH
Flag Meaning
-V, --version Print version and exit
-v, --verbose Show per-segment timestamps
-q, --quiet Suppress non-essential output
--json Output as JSON
-m, --model Whisper model (default: turbo)
-l, --language Language hint, e.g. zh, en
-o, --output Output file or directory
--device Inference device: auto, cpu, cuda
--compute-type Quantization: default, int8, float16, float32

Available Models

tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large-v1, large-v2, large-v3, large, distil-large-v2, distil-large-v3, distil-medium.en, distil-small.en, turbo

Python API

from tingxie import transcribe, transcribe_dir

# Single file
result = transcribe(audio_path="samples/20260610_125906.wav", model="turbo")
print(result.success)        # True
print(result.data["text"])   # transcribed text
print(result.data["language"])  # detected language

# Force CPU with int8 quantization
result = transcribe(
    audio_path="recording.wav",
    device="cpu",
    compute_type="int8",
)

# Directory batch
result = transcribe_dir(
    directory="samples/",
    model="turbo",
    output="transcripts/",
)
for filename, info in result.data.items():
    print(f"{filename}: {info['text'][:50]}...")

Agent Integration

from tingxie.tools import TOOLS, dispatch

# Use TOOLS in your OpenAI function-calling setup
# Then dispatch results:
result = dispatch("tingxie_transcribe", {
    "audio_path": "recording.wav",
    "model": "turbo",
    "device": "cpu",
})

Model Cache

Models are stored at ~/.cache/tingxie/models/ by default. Override with:

export TINGXIE_MODEL_DIR=/custom/path
tingxie recording.wav

Limitations

  • Requires FFmpeg installed on the system
  • First run with a model downloads it from ModelScope (~1GB for turbo)
  • Not suitable for real-time streaming
  • No speaker diarization (cannot distinguish multiple speakers)
  • GPU recommended for models larger than small

Development

pip install -e ".[dev]"
ruff format . && ruff check . && mypy . && pytest

License

GPLv3

Metadata

Release files for tingxie 0.2.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 tingxie 0.2.1
File Size Uploaded Provenance
tingxie-0.2.1.tar.gz 12.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tingxie 0.2.1
File Interpreter ABI Platform
tingxie-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / tingxie-0.2.1.tar.gz

Download URL tingxie-0.2.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
738173d43593f8bf8ce345ae8ff4cc57989d1ab022753bbb8f62297db61a646f
BLAKE2b-256 checksum
How to use checksums
3229127bf7cb18643da192069ed197aeb77dbe7c49612aa426fa1f4ef8eaf2d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / tingxie-0.2.1-py3-none-any.whl

Download URL tingxie-0.2.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ccbad6cbceaed75b299e735666487edfdeb33318d6d805743a5c4f9f6cd1d33
BLAKE2b-256 checksum
How to use checksums
df8be18896448464c236e0dcacc7af1dd817b9758ea757cec38f23123dd4735e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for tingxie 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

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