Skip to main content

Real-Time Speech-to-Speech Translation with Nuxt.js

This repository demonstrates how to use the Palabra API for real-time speech-to-speech translation from English to Spanish using Nuxt.js. It provides ~/composables/usePalabra.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.

Nuxt example cover

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.

Nuxt Example

See the usePalabra.ts for the code example with detailed explanations.