Metadata-Version: 2.4
Name: meetwave-stream
Version: 0.1.0
Summary: MeetWave streaming client: live English text over WebSocket, the full transcript at stop.
License-Expression: MIT
Project-URL: Homepage, https://meetwave.io/docs/api/streaming-sdk
Project-URL: Documentation, https://meetwave.io/docs/api/streaming-protocol
Keywords: speech-to-text,streaming,real-time,transcription,websocket,meetwave
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websockets>=13
Dynamic: license-file

# meetwave-stream (Python)

Live text while people speak (English, Spanish, Portuguese, Russian; German, French and
Italian as a preview), and the full transcript (with speakers and
names on those tiers, in any language) right after you stop.

```
pip install meetwave-stream
```

Python 3.10+; the only dependency is `websockets`.

```python
import asyncio
import os

import meetwave_stream


def show(final):
    print(final["start"], final["text"])


async def main(chunks):
    session = meetwave_stream.connect(api_key=os.environ["MEETWAVE_API_KEY"], tier="text", language="en")
    session.on("final", show)
    for pcm in chunks:  # 16 kHz mono 16-bit little-endian PCM, any chunk size
        session.send(pcm)
    result = await session.stop()
    print(result.transcript["text"])
```

- Send audio as soon as you have it. The first connection after a quiet period
  can take up to 15 s; the client keeps every word (up to 60 s) and sends it
  when the server is ready.
- A dropped connection is resumed on its own (6 attempts, 0.5 s to 8 s apart)
  from the last audio the server stored. Nothing is billed twice and no final
  is repeated.
- Events: `ready`, `partial`, `final`, `warning` (low balance), `reconnecting`,
  `error`, `closed`.
- Call `send`, `stop` and `close` from the event loop that runs the session.

## Tiers and languages

| tier | at stop |
|---|---|
| `text` | the transcript (English: joined live text, in seconds) |
| `speakers` | the transcript with speakers |
| `names` | the transcript with speakers and their names |

Every tier has the same live text. It depends on `language`:

| language | live text |
|---|---|
| `en`, `es`, `pt`, `ru` | yes |
| `de`, `fr`, `it` | yes, preview: rougher than the transcript at stop |
| any other code, or `"auto"` | none; the transcript at stop |

The client names the language in the connection address too (`.../v1/stream/ru`), so the
first text comes sooner.

Outside English, live text writes numbers as words; the transcript at stop has digits.
Billing is per second of audio at the tier's price.

Docs: https://meetwave.io/docs/api/streaming-sdk
