|
1 |
| -# Deepgram Speech-to-Text Plugin |
| 1 | +# FAL.ai Wizper Speech-to-Text and Translation Plugin |
2 | 2 |
|
3 |
| -A high-quality Speech-to-Text (STT) plugin for GetStream that uses the Deepgram API. |
| 3 | +High-quality real-time Speech-to-Text (STT) **and translation** for Stream, powered by |
| 4 | +[FAL.ai Wizper](https://fal.ai/models/wizper). |
4 | 5 |
|
5 | 6 | ## Installation
|
6 | 7 |
|
7 | 8 | ```bash
|
8 |
| -pip install getstream-plugins-deepgram |
| 9 | +pip install getstream-plugins-fal |
9 | 10 | ```
|
10 | 11 |
|
11 |
| -## Usage |
| 12 | +## Quick start |
12 | 13 |
|
13 | 14 | ```python
|
14 |
| -from getstream.plugins.deepgram import DeepgramSTT |
| 15 | +from getstream.plugins.fal import FalWizperSTT |
15 | 16 |
|
16 |
| -# Initialize with API key from environment variable |
17 |
| -stt = DeepgramSTT() |
| 17 | +# 1. Pure transcription (default) |
| 18 | +stt = FalWizperSTT() |
18 | 19 |
|
19 |
| -# Or specify API key directly |
20 |
| -stt = DeepgramSTT(api_key="your_deepgram_api_key") |
| 20 | +# 2. Translation to Spanish ("es") |
| 21 | +stt = FalWizperSTT(target_language="es") |
21 | 22 |
|
22 |
| -# Register event handlers |
23 | 23 | @stt.on("transcript")
|
24 |
| -def on_transcript(text, user, metadata): |
25 |
| - print(f"Final transcript from {user}: {text}") |
| 24 | +async def on_transcript(text: str, user: dict, metadata: dict): |
| 25 | + print(f"{user['name']} said → {text}") |
26 | 26 |
|
27 |
| -@stt.on("partial_transcript") |
28 |
| -def on_partial(text, user, metadata): |
29 |
| - print(f"Partial transcript from {user}: {text}") |
30 |
| - |
31 |
| -# Process audio |
| 27 | +# Send Stream PCM audio frames to the plugin |
32 | 28 | await stt.process_audio(pcm_data)
|
33 | 29 |
|
34 |
| -# When done |
| 30 | +# Close when finished |
35 | 31 | await stt.close()
|
36 | 32 | ```
|
37 | 33 |
|
38 |
| -## Configuration Options |
| 34 | +The plugin emits the standard Stream STT events: |
| 35 | + |
| 36 | +* `transcript` – final, high-confidence text |
| 37 | +* `error` – if Wizper returns a failure |
| 38 | + |
| 39 | +## Configuration options |
39 | 40 |
|
40 |
| -- `api_key`: Deepgram API key (default: reads from DEEPGRAM_API_KEY environment variable) |
41 |
| -- `options`: Deepgram LiveOptions for configuring the transcription |
42 |
| -- `sample_rate`: Sample rate of the audio in Hz (default: 16000) |
43 |
| -- `language`: Language code for transcription (default: "en-US") |
44 |
| -- `keep_alive_interval`: Interval in seconds to send keep-alive messages (default: 5.0) |
| 41 | +| Parameter | Type | Default | Description | |
| 42 | +|--------------------|--------|-------------|----------------------------------------------| |
| 43 | +| `target_language` | str\|None | `None` | ISO-639-1 code used when `task="translate"` | |
| 44 | +| `sample_rate` | int | `48000` | Incoming PCM sample rate (Hz) | |
45 | 45 |
|
46 | 46 | ## Requirements
|
47 | 47 |
|
48 |
| -- Python 3.10+ |
49 |
| -- deepgram-sdk>=4.5.0 |
50 |
| -- numpy>=2.2.6,<2.3 |
| 48 | +* Python 3.10+ |
| 49 | + |
| 50 | +## Why Wizper? |
| 51 | + |
| 52 | +Wizper is FAL.ai’s hosted version of Whisper v3 that streams results in |
| 53 | +real-time. This means you get: |
| 54 | + |
| 55 | +* Accurate multilingual transcription out-of-the-box |
| 56 | +* Fast first-word latency suitable for live calls |
| 57 | +* Optional on-the-fly translation to 100+ languages |
0 commit comments