-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamped speech-to-text transcription example (#1083)
- Loading branch information
Showing
2 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
# Speech-to-text | ||
|
||
This example show realtime transcription from audio to text. | ||
This example shows realtime transcription from voice to text. | ||
|
||
It uses Deepgram's STT API, but supports other STT plugins by changing this line: | ||
It uses OpenAI's Whisper STT API, but supports other STT plugins by changing this line: | ||
|
||
```python | ||
stt = deepgram.STT() | ||
stt = openai.STT() | ||
``` | ||
|
||
To render the transcriptions into your client application, refer to the [full documentation](https://docs.livekit.io/agents/voice-agent/transcriptions/). | ||
|
||
## Running the example | ||
|
||
```bash | ||
export DEEPGRAM_API_KEY=your-api-key | ||
python3 deepgram_stt.py start | ||
export LIVEKIT_URL=wss://yourhost.livekit.cloud | ||
export LIVEKIT_API_KEY=livekit-api-key | ||
export LIVEKIT_API_SECRET=your-api-secret | ||
export OPENAI_API_KEY=your-api-key | ||
|
||
python3 transcriber.py start | ||
``` | ||
|
||
Then connect to any room. For an example frontend, you can use LiveKit's [Agents Playground](https://agents-playground.livekit.io/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters