Metadata-Version: 2.4
Name: anyconv-speech-basic
Version: 1.0.1
Summary: AnyConv speech-to-text module using whisper.cpp
Author: AnyConv
License-Expression: MIT
Keywords: anyconv,speech,whisper,transcription,subtitles
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyconv-core<2.0,>=1.0
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Dynamic: license-file

# anyconv-speech-basic

Расшифровка аудио и видео через **whisper.cpp** с моделью `ggml-tiny`.

## Возможности

- **`speech-transcribe`** — аудио/видео → `text:plain`, SRT или WebVTT.
- Модель по умолчанию: `ggml-tiny.bin`.
- Аудио из видео извлекается FFmpeg в WAV 16 kHz mono.
- Настройки: `language` (`auto`, `ru`, `en`), `translate`.

## Требования

- [`whisper.cpp`](https://github.com/ggml-org/whisper.cpp) CLI (`whisper-cli`/`main`).
- Модель `ggml-tiny.bin`.
- FFmpeg в `PATH` или `ffmpeg_path`.

Пути задаются в конфигурации модуля:

```yaml
modules:
  config:
    com.gitlab.raceozr.speech-basic:
      whisper_path: /opt/whisper/whisper-cli
      model_path: /opt/whisper/ggml-tiny.bin
      ffmpeg_path: /usr/bin/ffmpeg
```

Можно использовать `WHISPER_CLI`, `WHISPER_MODEL` и `FFMPEG_PATH`.

## Установка

```bash
pip install "anyconv-core[all] @ git+https://gitlab.com/raceozr/anyconv-core.git@v1.0.0"
pip install "git+https://gitlab.com/raceozr/anyconv-modules.git@v1.0.1#subdirectory=modules/speech-basic"
# ?????????? ?? checkout anyconv-modules
cd modules/speech-basic
pip install -e ".[dev]"
pytest
anyconv module validate .
anyconv module test .
```
