Metadata-Version: 2.4
Name: nextcloud-talk-capture
Version: 0.1.0
Summary: Capture Nextcloud Talk calls: signalling client, per-speaker audio, call monitoring
Author: Done
License: MIT
Project-URL: Homepage, https://github.com/devsoftmus/done-transcription-app
Project-URL: Issues, https://github.com/devsoftmus/done-transcription-app/issues
Keywords: nextcloud,nextcloud-talk,webrtc,transcription,audio-capture
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Conferencing
Classifier: Topic :: Multimedia :: Sound/Audio :: Capture/Recording
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: websockets>=12.0
Requires-Dist: aiortc>=1.9.0
Requires-Dist: pymysql>=1.1.0
Requires-Dist: sshtunnel>=0.4.0
Requires-Dist: paramiko<4.0,>=3.0

# nextcloud-talk-capture

Capture **Nextcloud Talk** calls: join as a signalling client, receive one audio
stream per speaker, and hand over the finished call as plain data.

Import name is `talk_capture`.

```python
from talk_capture import CaptureConfig
from talk_capture.monitor import CallMonitor
from talk_capture.spreed_client import SpreedClient
```

## What it does — and what it deliberately does not

This is the capture half of a transcription pipeline: it gets the audio and
tells you who was speaking. What happens afterwards — speech recognition,
summaries, publishing, storage — is not its business, and it holds no dependency
on any of it.

That separation is the whole point. The same package runs inside a Nextcloud
ExApp, inside a standalone capture service, or inside an application that does
everything, without dragging a product's worth of code along.

| Module | |
|---|---|
| `spreed_client` | signalling client: HPB + aiortc, per-speaker audio |
| `monitor` | active-call detection (polls the Nextcloud DB, optionally over an SSH tunnel) |
| `presence` | join/leave annotations (pure functions, no I/O) |
| `chat_commands` | opt-out commands posted in the room chat, honoured mid-call |
| `resolve` | assembles a `FinishedCall` when the call ends |
| `transcriber_backend` | sends audio to an engine, in-process or over gRPC |
| `contracts` | `FinishedCall`, `SpeakerStatInput` — the payload handed downstream |
| `config` | `CaptureConfig` — what capture needs, nothing more |
| `aioice_patch` | works around an aioice race; import it before aiortc |

## Requirements

- Nextcloud Talk with a **High Performance Backend**. Call media lives in the
  signalling server, not in the PHP layer, so an HPB is required.
- Python 3.11+

## Configuration

`CaptureConfig` carries what capture needs: Nextcloud credentials, the
signalling server and its secret, call-detection database access, the room
filter, and where to send the audio. Build it from the environment with
`CaptureConfig.from_env()`, or pass any object exposing the same attributes —
config is taken duck-typed, so a larger application config works unchanged.

## Contributing

Two rules keep the package shippable on its own, both enforced by tests in the
consuming repository:

- nothing here may import the downstream half (publishing, analysis, storage);
- a config field must keep its name, type and default in sync with any larger
  config that is passed in — a mismatch fails mid-call, not at import.

## Licence

MIT.
