Close Menu
StreamLineCrypto.comStreamLineCrypto.com
  • Home
  • Crypto News
  • Bitcoin
  • Altcoins
  • NFT
  • Defi
  • Blockchain
  • Metaverse
  • Regulations
  • Trading
What's Hot

Semler Scientific Plans To Hold 105,000 Bitcoin By 2027

June 20, 2025

Bitcoin Price Could Be Headed For A Surprise Move

June 19, 2025

relief rally or true trend reversal?

June 19, 2025
Facebook X (Twitter) Instagram
Friday, June 20 2025
  • Contact Us
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms of Use
  • DMCA
Facebook X (Twitter) Instagram
StreamLineCrypto.comStreamLineCrypto.com
  • Home
  • Crypto News
  • Bitcoin
  • Altcoins
  • NFT
  • Defi
  • Blockchain
  • Metaverse
  • Regulations
  • Trading
StreamLineCrypto.comStreamLineCrypto.com

Building Real-Time Language Translation with AssemblyAI and DeepL in JavaScript

July 14, 2024Updated:July 14, 2024No Comments4 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Building Real-Time Language Translation with AssemblyAI and DeepL in JavaScript
Share
Facebook Twitter LinkedIn Pinterest Email
ad


Ted Hisokawa
Jul 14, 2024 05:20

Learn to create a real-time language translation service utilizing AssemblyAI and DeepL in JavaScript. Step-by-step information for builders.





In a complete tutorial, AssemblyAI presents insights into making a real-time language translation service utilizing JavaScript. The tutorial leverages AssemblyAI for real-time speech-to-text transcription and DeepL for translating the transcribed textual content into numerous languages.

Introduction to Actual-Time Translation

Translations play a vital function in communication and accessibility throughout completely different languages. For example, a vacationer in another country might battle to speak if they do not perceive the native language. AssemblyAI’s Streaming Speech-to-Textual content service can transcribe speech in real-time, which may then be translated utilizing DeepL, making communication seamless.

Setting Up the Venture

The tutorial begins with organising a Node.js undertaking. Important dependencies are put in, together with Categorical.js for making a easy server, dotenv for managing setting variables, and the official libraries for AssemblyAI and DeepL.

mkdir real-time-translation
cd real-time-translation
npm init -y
npm set up specific dotenv assemblyai deepl-node

API keys for AssemblyAI and DeepL are saved in a .env file to maintain them safe and keep away from exposing them within the frontend.

Creating the Backend

The backend is designed to maintain API keys safe and generate short-term tokens for safe communication with the AssemblyAI and DeepL APIs. Routes are outlined to serve the frontend and deal with token era and textual content translation.

const specific = require("specific");
const deepl = require("deepl-node");
const { AssemblyAI } = require("assemblyai");
require("dotenv").config();

const app = specific();
const port = 3000;

app.use(specific.static("public"));
app.use(specific.json());

app.get("https://blockchain.information/", (req, res) => {
  res.sendFile(__dirname + "/public/index.html");
});

app.get("/token", async (req, res) => {
  const token = await consumer.realtime.createTemporaryToken({ expires_in: 300 });
  res.json({ token });
});

app.submit("/translate", async (req, res) => {
  const { textual content, target_lang } = req.physique;
  const translation = await translator.translateText(textual content, "en", target_lang);
  res.json({ translation });
});

app.hear(port, () => {
  console.log(`Listening on port ${port}`);
});

Frontend Growth

The frontend consists of an HTML web page with textual content areas for displaying the transcription and translation, and a button to begin and cease recording. The AssemblyAI SDK and RecordRTC library are utilized for real-time audio recording and transcription.

Voice Recorder with Transcription 

ad
What's New Here!
Semler Scientific Plans To Hold 105,000 Bitcoin By 2027
June 20, 2025
Bitcoin Price Could Be Headed For A Surprise Move
June 19, 2025
relief rally or true trend reversal?
June 19, 2025
Bitcoin Top Is In And Price Is Headed For $92,000, Analyst Warns
June 19, 2025
X transforms into a finance hub but sidesteps crypto—for now
June 19, 2025
Facebook X (Twitter) Instagram Pinterest
  • Contact Us
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms of Use
  • DMCA
© 2025 StreamlineCrypto.com - All Rights Reserved!

Type above and press Enter to search. Press Esc to cancel.