Real-Time Speech-to-Speech Translation with TypeScript
This repository demonstrates how to use the Palabra API for real-time speech-to-speech translation from English to Spanish using TypeScript (JavaScript).
It provides ~/src/main.ts
file with clear and step-by-step code examples (relevant to the Palabra Quick Start Guide).
The repository allows to build the project locally with just a few simple commands, enabling you to experience real-time translation of your own speech directly in your browser.
Key Features:
-
Real-Time Speech Translation: The application integrates with the Palabra API to provide real-time speech translation using WebSockets for translation configuration and transcriptions.
-
WebRTC Audio Streaming with LiveKit: WebRTC, powered by LiveKit, enables low-latency audio streaming. LiveKit is used for sending and receiving the audio streams, ensuring efficient communication between the user and the translation system.
-
Automatic Session Creation: A streaming session is created automatically by sending a request to the Palabra API, which returns session details, including control URLs and tokens.
-
Translation Control via WebSocket: The WebSocket connection is used to manage translation configuration and control the translation flow, including receiving real-time transcriptions and audio.
TypeScript Example
See the main.ts for the code example with detailed explanations.
Links
- Gitlab Repository
- README for more details
- Palabra Quick Start Guide