Metadata-Version: 2.4
Name: whisper-tools
Version: 0.1.0
Summary: Real-time speech recognition with Whisper
Author: Your Name
Author-email: Kirill Yuzhakov <luxlapari@gmail.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: sounddevice>=0.4.6
Requires-Dist: soundfile>=0.12.1
Requires-Dist: openai>=1.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: librosa>=0.10.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Dynamic: author
Dynamic: requires-python

# Whisper-tools
#### High-level python library for stream and static transcription with whisper

## Translating .wav file

1. Using local model
```python
def example_file_transcription():
    whisper_local = WhisperLocal(model_name="openai/whisper-tiny")
    text = whisper_local.transcribe_file("sound_example.wav")
    print(text)
```

2. Using llm api
```python
def example_file_transcription():
    whisper_local = WhisperAPI(api_key="your_key", base_url="your_url")
    text = whisper_local.transcribe_file("sound_example.wav")
    print(text)
```

## Stream translating 

1. Using local model
```python
def example_streaming():
    recorder = StreamRecorder(WhisperLocal(model_name="openai/whisper-tiny"))

    try:
        recorder.start_recording()
        print("Recording... Press Ctrl+C to stop")
        while True:
            text = recorder.process_chunk()
            if text:
                print(f"Recognized: {text}")
    except KeyboardInterrupt:
        print("\nStopping...")
    finally:
        recorder.stop_recording()
```

2. Using llm api
```python
def example_streaming():
    recorder = StreamRecorder(WhisperAPI(api_key="your_key", base_url="your_url"))

    try:
        recorder.start_recording()
        print("Recording... Press Ctrl+C to stop")
        while True:
            text = recorder.process_chunk()
            if text:
                print(f"Recognized: {text}")
    except KeyboardInterrupt:
        print("\nStopping...")
    finally:
        recorder.stop_recording()
```
