Skip to main content

A user-friendly package for Thai speech recognition using the Typhoon ASR model.

Project description

Typhoon ASR

A user-friendly Python package for Thai speech recognition using the Typhoon ASR model.

Installation

pip install typhoon-asr

Quick Start

Python API

from typhoon_asr import transcribe

# Basic transcription
result = transcribe("audio.wav")
print(result['text'])

# With word timestamps (estimated)
result = transcribe("audio.wav", with_timestamps=True)
print(result['text'])
for ts in result['timestamps']:
    print(f"[{ts['start']:.2f}s - {ts['end']:.2f}s] {ts['word']}")

# Specify device
result = transcribe("audio.wav", device="cuda")  # or "cpu", "auto"

Command Line

# Basic usage
typhoon-asr audio.wav

# With timestamps
typhoon-asr audio.wav --with-timestamps

# Specify device
typhoon-asr audio.wav --device cuda

Supported Formats

  • .wav, .mp3, .m4a, .flac, .ogg, .aac, .webm

API Reference

transcribe(input_file, model_name="scb10x/typhoon-asr-realtime", with_timestamps=False, device="auto")

Parameters:

  • input_file (str): Path to audio file
  • model_name (str): HuggingFace model identifier
  • with_timestamps (bool): Generate estimated word timestamps
  • device (str): Processing device ("auto", "cpu", "cuda")

Returns:

  • dict with keys:
    • text: Transcribed text
    • timestamps: List of word timestamps (if enabled)
    • processing_time: Processing duration in seconds
    • audio_duration: Audio duration in seconds

Requirements

  • Python ≥ 3.8
  • CUDA (optional, for GPU acceleration)

License

Apache Software License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typhoon_asr-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typhoon_asr-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file typhoon_asr-0.1.0.tar.gz.

File metadata

  • Download URL: typhoon_asr-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for typhoon_asr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7da36a08b89342f5b54fb2c329d9463c83c4763e93d20a4aa7b5c4bcd3013ae7
MD5 027f068318d207ea5d2d4f6e8eba4bf4
BLAKE2b-256 136d808c7d76ff160e25a035c20587c97ccd4ea285a7bfee5b360545e887e930

See more details on using hashes here.

File details

Details for the file typhoon_asr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: typhoon_asr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for typhoon_asr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ccfe67d03138a4d7b51fa1de29d199ce7e64724e1760e39d792e958e9e6cc2d
MD5 e38396e8204d7b5b69ec3a493f9a5572
BLAKE2b-256 d8257470b7496fb406a2faad8ccdb382d2e29fa6c50c19c9b3324e53a221ab07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page